Solve Hubble's Law for velocity, distance, redshift, and universe age
The Hubble Constant Calculator is an interactive astronomy tool that lets you apply Hubble's Law in any direction — solving for recession velocity, galaxy distance, the Hubble constant itself, or the redshift of a galaxy from its spectral lines. Whether you are a student, an amateur astronomer, or simply curious about the expanding universe, this calculator brings the equations of modern cosmology to your fingertips without requiring advanced mathematics. Hubble's Law, named after astronomer Edwin Hubble who published his landmark 1929 paper, states that the recession velocity of a distant galaxy is proportional to its distance from us: v = H₀ × d. The proportionality constant H₀ — the Hubble constant — tells us how fast the universe is expanding. A galaxy located 1 megaparsec (Mpc) away from us recedes at a speed of roughly 70 kilometers per second. A galaxy twice as far recedes at twice the speed. This simple, elegant relationship underlies much of our understanding of the Big Bang and the age, size, and fate of the universe. This calculator supports four distinct computation modes. In Velocity Mode you enter a galaxy's distance and the Hubble constant to find its recession speed. In Distance Mode you provide the recession velocity and H₀ to derive the galaxy's distance. In Hubble Constant Mode you supply both velocity and distance measured for a galaxy to calculate H₀ directly — the same approach real observational astronomers use. Finally, Wavelength/Redshift Mode lets you enter the observed and rest wavelengths of a spectral absorption or emission line to compute the galaxy's redshift z, from which recession velocity and distance follow automatically. All four modes apply the relativistic correction whenever the redshift z exceeds 0.1, at which point the Newtonian approximation v = cz overestimates the true velocity. The relativistic formula v = c×[(z+1)²−1]/[(z+1)²+1] keeps the computed speed physically valid — it can never exceed the speed of light regardless of how large z grows. For spectroscopy mode, six spectral line presets are built in: the calcium II K and H lines (3933.7 Å and 3968.5 Å), H-beta (4861.3 Å), magnesium I b (5183.6 Å), sodium I D (5892.5 Å), and H-alpha (6562.8 Å). Click any preset to populate the rest wavelength field instantly. Beyond the core Hubble computation, the calculator also derives the estimated age of the universe from your chosen H₀ value, the Hubble parameter at redshift H(z) using the matter-dominated approximation, the recession velocity expressed as a fraction of the speed of light, and the galaxy distance in four unit systems simultaneously: megaparsecs, light-years, parsecs, and kilometers. Three H₀ presets — the Planck 2018 CMB value (67.4 km/s/Mpc), the SH0ES distance-ladder value (73.0 km/s/Mpc), and Hubble's original 1929 estimate (50 km/s/Mpc) — allow you to explore the Hubble Tension controversy interactively. Results are rendered as a horizontal bar showing recession speed as a percentage of c, a conic donut chart visualizing the same fraction, and a comparative bar chart showing how the estimated universe age differs between Planck, SH0ES, and your chosen H₀ value. Export your results to CSV for use in lab reports or personal research, or print a clean summary for classroom use.
Understanding Hubble's Law and the Expanding Universe
What Is the Hubble Constant?
The Hubble constant H₀ quantifies the current rate of expansion of the universe. It has units of kilometers per second per megaparsec (km/s/Mpc), meaning that for every megaparsec of distance between us and a distant galaxy, that galaxy appears to recede at H₀ kilometers per second faster. The subscript zero indicates the present-day value, since the expansion rate changes over cosmic time. Current measurements place H₀ between roughly 67 and 73 km/s/Mpc depending on the measurement method, a disagreement known as the Hubble Tension that remains one of the most significant open problems in cosmology. The inverse of H₀, after unit conversion, gives a rough estimate of the age of the universe — approximately 13.8 billion years at H₀ = 70 km/s/Mpc.
How Is Recession Velocity Calculated?
Hubble's Law in its basic form is v = H₀ × d, where v is the recession velocity in km/s and d is the proper distance in megaparsecs. For nearby galaxies (z < 0.1) the approximation v ≈ cz holds, where z = (λ_observed − λ_rest)/λ_rest is the cosmological redshift. For more distant objects where z ≥ 0.1, the relativistic formula v = c×[(z+1)²−1]/[(z+1)²+1] must be used to prevent the unphysical result of velocities exceeding the speed of light. The universe age is estimated as t ≈ (1/H₀)×(Mpc_to_km)/(seconds_per_year×1e9) Gyr. The Hubble parameter at a different redshift epoch is approximated as H(z) = H₀×(1+z)^1.5 in the matter-dominated limit.
Why Does the Hubble Constant Matter?
H₀ is one of the most fundamental numbers in cosmology. It sets the scale of the observable universe, determines the age of the cosmos, and governs how rapidly structures form over time. Measuring H₀ with precision allows astronomers to test the standard cosmological model (ΛCDM), constrain dark energy, and probe physics beyond the Standard Model. The ongoing discrepancy between H₀ derived from the cosmic microwave background (67.4 km/s/Mpc by Planck) and from the local distance ladder using Cepheid variables and Type Ia supernovae (73.0 km/s/Mpc by SH0ES) suggests either unaccounted systematic errors in one or both methods, or new physics that modified the expansion history of the early universe.
Limitations and Caveats
This calculator uses simplified formulas appropriate for educational and amateur astronomy purposes. The universe age estimate does not include the ΛCDM correction factor (which reduces it by approximately 2/3 relative to the pure Hubble time), so the resulting age is slightly overestimated compared to the accepted 13.8 billion years. The H(z) formula uses the matter-dominated approximation H(z) = H₀×(1+z)^1.5, which is not accurate at low redshift where dark energy dominates. The Hubble parameter at low z is better computed as H(z) = H₀×√(Ω_m(1+z)³ + Ω_Λ) using the full ΛCDM equation. Proper comoving distances — important for cosmological calculations beyond nearby galaxies — are not computed here, as they require numerical integration of the Friedmann equations. For high-precision work, use dedicated cosmological codes such as CAMB or Astropy.
Key Formulas
Hubble's Law
v = H₀ × d
The recession velocity (v) of a galaxy in km/s equals the Hubble constant (H₀) in km/s/Mpc multiplied by its distance (d) in megaparsecs. This linear relationship is the foundation of observational cosmology.
Universe Age Estimate
t ≈ 1 / H₀ ≈ (3.086 × 10¹⁹ km/Mpc) / (H₀ × 3.156 × 10¹⁶ s/Gyr)
The Hubble time — the reciprocal of H₀ after unit conversion — gives a rough estimate of the age of the universe. At H₀ = 70 km/s/Mpc, this yields approximately 13.97 billion years.
Relativistic Recession Velocity
v = c × [(z+1)² − 1] / [(z+1)² + 1]
For galaxies with redshift z ≥ 0.1, the relativistic Doppler formula must be used instead of v = cz to keep the velocity below the speed of light c.
Distance from Redshift
d = v / H₀
Rearranging Hubble's Law to solve for distance. After computing the recession velocity from the measured redshift, divide by H₀ to obtain the galaxy's distance in megaparsecs.
Reference Tables
Hubble Constant Measurements Over Time
Key historical and modern measurements of H₀, showing how estimates have converged — and the remaining Hubble Tension between CMB and local distance ladder methods.
| Measurement | Year | H₀ (km/s/Mpc) | Method |
|---|---|---|---|
| Hubble (original) | 1929 | ~500 | Cepheids (miscalibrated) |
| Sandage | 1958 | 75 | Revised Cepheid calibration |
| HST Key Project | 2001 | 72 ± 8 | Cepheids + Type Ia supernovae |
| WMAP 9-year | 2012 | 69.3 ± 0.8 | Cosmic microwave background |
| Planck 2018 | 2018 | 67.4 ± 0.5 | CMB power spectrum (ΛCDM) |
| SH0ES (Riess) | 2022 | 73.0 ± 1.0 | Cepheids + Type Ia supernovae |
| JWST + CCHP | 2024 | 69.9 ± 1.8 | TRGB + JWST photometry |
Hubble Tension Summary
The two main measurement approaches and their implications for cosmology.
| Approach | H₀ (km/s/Mpc) | Universe Age (Gyr) | Tension |
|---|---|---|---|
| CMB (Planck ΛCDM) | 67.4 ± 0.5 | ~13.8 | Early-universe measurement |
| Local Distance Ladder (SH0ES) | 73.0 ± 1.0 | ~13.4 | Late-universe measurement |
| Discrepancy | ~5.6 km/s/Mpc | ~0.4 Gyr | 5σ significance |
Worked Examples
Recession Velocity of a Galaxy at 100 Mpc
A galaxy is observed at a distance of 100 megaparsecs. Using H₀ = 70 km/s/Mpc, find its recession velocity.
Apply Hubble's Law: v = H₀ × d
v = 70 km/s/Mpc × 100 Mpc
v = 7,000 km/s
Check: z = v/c = 7,000 / 299,792 ≈ 0.023 (z < 0.1, so non-relativistic formula is valid)
The galaxy recedes at 7,000 km/s, about 2.3% of the speed of light.
Estimate Universe Age from H₀ = 73 km/s/Mpc
Using the SH0ES measurement of H₀ = 73 km/s/Mpc, estimate the Hubble time (age of the universe).
Convert H₀ to inverse seconds: H₀ = 73 / (3.086 × 10¹⁹) s⁻¹ = 2.366 × 10⁻¹⁸ s⁻¹
Take the reciprocal: t = 1 / H₀ = 4.226 × 10¹⁷ s
Convert to gigayears: t = 4.226 × 10¹⁷ / 3.156 × 10¹⁶ ≈ 13.39 Gyr
The Hubble time is approximately 13.4 billion years — slightly less than the Planck estimate of 13.8 Gyr, reflecting the higher expansion rate.
Distance from an Observed Redshift of z = 0.5
A galaxy has a measured cosmological redshift of z = 0.5. Using H₀ = 70 km/s/Mpc, find the recession velocity and distance.
Since z = 0.5 > 0.1, use the relativistic formula: v = c × [(1.5)² − 1] / [(1.5)² + 1]
v = 299,792 × (2.25 − 1) / (2.25 + 1) = 299,792 × 1.25 / 3.25
v = 299,792 × 0.3846 ≈ 115,335 km/s
d = v / H₀ = 115,335 / 70 ≈ 1,648 Mpc
The galaxy is approximately 1,648 Mpc away, receding at about 38.5% of the speed of light.
How to Use the Hubble Constant Calculator
Choose a Calculation Mode
Select one of the four tabs at the top: Solve Velocity (need distance and H₀), Solve Distance (need velocity and H₀), Solve H₀ (need both velocity and distance), or Wavelength/Redshift (need spectral line wavelengths). The input fields will update automatically for the chosen mode.
Set the Hubble Constant
The Hubble constant field defaults to 70.3 km/s/Mpc. Use the preset buttons to switch between Planck 2018 (67.4), SH0ES (73.0), or Hubble’s original 1929 estimate (50). You can also type any custom value. The universe age and H(z) will update instantly.
Enter Your Galaxy Data
Type the known values into the input fields. For velocity, choose units (km/s, m/s, or fraction of c). For distance, choose Mpc, light-years, parsecs, or km. In Wavelength mode, use the spectral line preset buttons (Ca II K, H-alpha, etc.) to populate the rest wavelength automatically, then enter the observed wavelength from your spectrum.
Read Results and Export
Results appear instantly on the right. You will see the primary solved quantity, recession speed as a percentage of c, distance in four unit systems, estimated universe age, and H(z) at the computed redshift. A comparative bar chart shows how the universe age varies between Planck, SH0ES, and your chosen H₀. Click Export CSV to download all values, or Print Results for a clean printout.
Frequently Asked Questions
What is the Hubble constant and what are its units?
The Hubble constant H₀ describes how fast the universe is expanding today. Its units are kilometers per second per megaparsec (km/s/Mpc), meaning that for every additional megaparsec of distance from Earth, a galaxy appears to recede at H₀ more km/s. A galaxy 100 Mpc away recedes at roughly 7,000 km/s if H₀ = 70. H₀ can also be expressed in SI units of inverse seconds (s⁻¹), but the km/s/Mpc convention is nearly universal in observational astronomy. Its value changes over cosmic time as the expansion rate evolves; the subscript zero denotes the present-epoch value. Current best estimates range from 67.4 (Planck CMB) to 73.0 (SH0ES distance ladder) km/s/Mpc.
What is the Hubble Tension?
The Hubble Tension is the statistically significant discrepancy between two independent measurements of H₀. Measurements using the cosmic microwave background and the standard ΛCDM cosmological model (Planck 2018) give H₀ ≈ 67.4 km/s/Mpc, while measurements using the local distance ladder — Cepheid variable stars calibrating Type Ia supernovae — (SH0ES team) give H₀ ≈ 73.0 km/s/Mpc. The disagreement is now at the 5-sigma level, making systematic error increasingly implausible as the sole explanation. Proposed resolutions include early dark energy, extra relativistic species, or modifications to the recombination epoch. As of 2026, the tension remains unresolved and is one of the leading open problems in cosmology.
When do I need to use the relativistic formula?
The simple formula v = cz is only valid for small redshifts (roughly z < 0.1, corresponding to velocities less than about 10% of the speed of light). At higher redshifts, the non-relativistic approximation overestimates the true recession velocity and can even give results exceeding c, which is physically impossible. The relativistic Doppler formula v = c×[(z+1)²−1]/[(z+1)²+1] should be used for z ≥ 0.1. This calculator applies the correction automatically and displays a note when it has been used. For context, a galaxy at z = 1 has a true recession velocity of about 0.6c using the relativistic formula, whereas v = cz would incorrectly give exactly c.
How is the universe age calculated from H₀?
The simplest estimate of the universe age is the Hubble time: t_H = 1/H₀. After converting H₀ from km/s/Mpc to inverse seconds (by dividing by the number of kilometers in a megaparsec, 3.086×10¹⁹ km), the result is a time in seconds which is then converted to gigayears. At H₀ = 70 km/s/Mpc, t_H ≈ 13.97 Gyr. In reality the true age is slightly less because the expansion was decelerating in the matter-dominated era and is now accelerating due to dark energy. The ΛCDM correction gives an age of about 13.8 Gyr for H₀ = 67.4. This calculator uses the pure Hubble time without the ΛCDM correction factor, so the displayed age is a slight overestimate.
How do spectral lines reveal a galaxy's recession velocity?
Galaxies contain familiar elements like hydrogen, calcium, magnesium, and sodium. These elements emit and absorb light at precise, laboratory-measured wavelengths called rest wavelengths. When a galaxy is moving away from us, the Doppler effect stretches the wavelengths of its light toward the red end of the spectrum — a phenomenon called cosmological redshift. By comparing the observed wavelength of a spectral line in a galaxy's spectrum to its known rest wavelength, astronomers compute the redshift z = (λ_obs − λ_rest)/λ_rest. This z value then gives the recession velocity via Hubble's Law. The Ca II K (3934 Å) and H-alpha (6563 Å) lines are among the most commonly used for this purpose in optical spectroscopy.
What is H(z) and why does the Hubble parameter change with redshift?
The Hubble parameter H(z) describes the expansion rate of the universe at the cosmic epoch corresponding to redshift z. Because the universe was smaller and denser in the past, its expansion rate was different — faster during the matter-dominated era and slower before dark energy began to dominate. In the matter-dominated approximation (valid roughly for 1 < z < 100), H(z) ≈ H₀×(1+z)^1.5. The full ΛCDM formula is H(z) = H₀×√[Ω_m(1+z)³ + Ω_Λ], where Ω_m ≈ 0.31 is the matter density parameter and Ω_Λ ≈ 0.69 is the dark energy density parameter. This calculator uses the simplified matter-dominated formula, which overestimates H(z) at low redshift where dark energy is important.
Related Tools
Redshift Calculator
Calculate cosmological redshift, relativistic Doppler shift, and recession velocity from observed and rest wavelengths.
Parallax Distance Calculator
Convert stellar parallax angles to distances in parsecs, light-years, AU, and km using the geometric parallax method.
Star Magnitude Calculator
Compute apparent and absolute magnitudes, brightness ratios, luminosity, and distance modulus for any star.
Schwarzschild Radius Calculator
Calculate the event horizon radius of a black hole from its mass using the Schwarzschild solution.
Delta-V Calculator
Compute the delta-v budget for spacecraft maneuvers using the Tsiolkovsky rocket equation.