We prove the analog of Cramer's short intervals theorem for primes in arithmetic progressions and prime ideals, under the relevant Riemann hypothesis. Both results are uniform in the data of the underlying structure. Our approach is based mainly on the inertia property of the counting functions of primes and prime ideals.