Skip to content
MoneyDeck

Redshift & Hubble’s Law Calculator

Turn a spectral line shift into redshift, recession speed and distance

Updated · Free, no signup

nm
nm

Hα 656.28, Hβ 486.13, Lyman-α 121.57, Ca II K 393.37 nm.

km/s/Mpc

Planck 2018: 67.4; SH0ES distance ladder: ~73.

Redshift z

0.03614

Relativistic Doppler velocity

10,639.7 km/s

Velocity as fraction of light speed (v/c)

0.03549

Hubble-law distance (cz/H₀)

154.8 Mpc

Reliable only for z ≲ 0.1.

Comoving distance (ΛCDM)

153.5 Mpc

Luminosity distance

159.1 Mpc

Lookback (light-travel) time

0.492 billion years

Age of the universe at that redshift

12.975 billion years

Scale factor a = 1/(1+z)

0.96512

  • Light from this object left it 0.49 billion years ago; it is now 501 million light-years away (comoving).

About the Redshift & Hubble’s Law Calculator

This redshift calculator converts between the three ways astronomers describe how fast something is moving away: the shift of a spectral line (observed vs rest wavelength), the redshift z itself, and the radial velocity. From z it then estimates distance with Hubble’s law (d = cz/H₀) and, for larger redshifts, the comoving distance, luminosity distance and lookback time in a flat ΛCDM universe.

Students working through spectroscopy or cosmology problems, amateur spectroscopists measuring quasars, and anyone curious how far away a galaxy at z = 0.5 really is can use it. Enter a line such as hydrogen-alpha (656.28 nm) and the wavelength where you observed it, or type z or a velocity directly, and choose the Hubble constant and matter density you want to assume.

The relativistic velocity shown is the special-relativity Doppler speed, which is exact for motion through space but only an interpretation for cosmological redshift. Hubble’s law in its simple form is reliable only for z below about 0.1; beyond that use the comoving distance. Radiation is neglected, so ages very close to the Big Bang (z ≳ 1,000) are approximate.

With the default inputs, the redshift z is 0.03614. Change any value above to recalculate instantly.

How to use the redshift & hubble’s law calculator

  1. 1Choose whether you know the wavelengths, the redshift z, or a velocity.
  2. 2Enter the observed and rest wavelength (same units), or z, or the velocity in km/s.
  3. 3Set the Hubble constant and matter density, or keep the 70 / 0.3 defaults.
  4. 4Read z, the recession velocity and the Hubble-law distance.
  5. 5For z above about 0.1, use the comoving distance and lookback time.

Formula and method

z = λ_obs/λ_rest − 1; v = c[(1+z)² − 1]/[(1+z)² + 1]; d = cz/H₀; D_C = (c/H₀)∫₀ᶻ dz′/E(z′), E(z) = √(Ωm(1+z)³ + ΩΛ)

Redshift is the fractional stretch of a spectral line. The relativistic Doppler formula converts it to a radial velocity that never exceeds the speed of light; for small z it is close to v = cz. Hubble’s law d = v/H₀ ≈ cz/H₀ then gives a distance in megaparsecs that is accurate for nearby galaxies.

For larger redshifts the expansion history matters. The calculator assumes a flat universe with matter density Ωm and dark energy ΩΛ = 1 − Ωm (radiation neglected) and numerically integrates the Friedmann equation with Simpson’s rule to get the comoving distance, the luminosity distance D_L = (1+z)·D_C, the lookback time (1/H₀)∫dz/[(1+z)E(z)], and the age of the universe when the light was emitted.

z
Redshift
λ
Observed and rest-frame wavelengths
c
Speed of light, 299,792.458 km/s
H₀
Hubble constant (km/s per megaparsec)
Ωm, ΩΛ
Matter and dark-energy density parameters (sum to 1)

Worked examples

Hα line observed at 680 nm

z = 680 ÷ 656.28 − 1 = 0.0361. The relativistic velocity is about 10,640 km/s, and Hubble’s law with H₀ = 70 puts the galaxy at about 155 Mpc (505 million light-years); light left it about 490 million years ago.

A galaxy at z = 0.5

With H₀ = 70 and Ωm = 0.3, the comoving distance is 1,889 Mpc and the luminosity distance 2,833 Mpc. The light set out 5.04 billion years ago, when the universe was 8.43 billion years old and two-thirds its present size.

Receding at 10,000 km/s

β = 10,000 ÷ 299,792 = 0.0334, so 1 + z = √((1+β)/(1−β)) = 1.0339. Hubble’s law gives about 145 Mpc, almost identical to the ΛCDM comoving distance at such a small redshift.

A very early galaxy at z = 6

At z = 6 the light has travelled 12.55 billion years, leaving when the universe was only about 0.92 billion years old. The galaxy is now about 8,250 Mpc (26.9 billion light-years) away in comoving terms.

Frequently asked questions

How do you calculate redshift?+

Divide the observed wavelength of a spectral line by its known laboratory (rest) wavelength and subtract 1: z = λ_obs/λ_rest − 1. For example, hydrogen-alpha at 656.28 nm observed at 680 nm gives z ≈ 0.036.

What is Hubble’s law?+

It states that galaxies recede at a speed proportional to their distance: v = H₀ × d. With H₀ ≈ 70 km/s/Mpc, a galaxy 100 megaparsecs away recedes at about 7,000 km/s. It holds well for redshifts below about 0.1.

Can redshift be greater than 1 if nothing moves faster than light?+

Yes. Cosmological redshift comes from the expansion of space stretching light during its journey, not from motion through space, so z can be 10 or more. The relativistic Doppler speed shown is always below c, but it is only one interpretation for distant galaxies.

What value of the Hubble constant should I use?+

Measurements disagree: the Planck satellite’s cosmic microwave background analysis gives about 67.4 km/s/Mpc, while the Cepheid–supernova distance ladder gives about 73. This “Hubble tension” is unresolved; 70 is a common round compromise.

What is the difference between comoving distance and lookback time?+

Lookback time is how long the light travelled. Comoving distance is how far away the object is now, after the universe kept expanding during that time — so it is larger than the light-travel time multiplied by c.

Related tools