Compute cosmological distances, recession velocity, and lookback time from spectral redshift
The redshift calculator is an essential tool for astronomers, astrophysics students, and space enthusiasts who want to understand how fast a celestial object is moving away from us and how far back in cosmic time we are looking. When light travels across the expanding universe, its wavelength stretches, shifting toward the red end of the electromagnetic spectrum. The more the light shifts — the higher the redshift value z — the farther away and more ancient the source. This free tool supports three calculation modes: Wavelength Mode (enter observed and rest wavelengths from a spectrograph), Redshift Mode (enter a known z value from a catalog), and Velocity Mode (convert recession speed back into redshift and distance). Understanding redshift unlocks the entire field of observational cosmology. When Edwin Hubble measured the recession velocities of nearby galaxies in 1929, he discovered that the universe is expanding — a finding that transformed our understanding of the cosmos. Today, astronomers use redshift to measure distances across billions of light-years, study the large-scale structure of the universe, trace the formation of galaxies in the early universe, and constrain fundamental cosmological parameters like the Hubble constant and dark energy density. This calculator implements the standard ΛCDM (Lambda Cold Dark Matter) cosmological model with default Planck 2018 parameters: H₀ = 67.4 km/s/Mpc, Ω_m = 0.315, and Ω_Λ = 0.685. These parameters represent the best-fit cosmological model from the European Space Agency's Planck satellite mission, which measured temperature fluctuations in the cosmic microwave background (CMB) with extraordinary precision. You can also switch to WMAP 9-year parameters or enter fully custom values for research and comparison purposes. For recession velocities, the calculator always uses the relativistic Doppler formula v = c × [(1+z)² − 1] / [(1+z)² + 1], which gives physically correct results for all values of z. The non-relativistic approximation v ≈ c × z is accurate only for small redshifts (z < 0.1) and breaks down at high z. Note that cosmological recession velocities can exceed the speed of light — this does not violate special relativity because it is space itself that is expanding, not matter moving through space. The tool calculates four key cosmological distances: comoving radial distance (the proper distance between two objects in a co-expanding reference frame, accounting for the universe's expansion), luminosity distance (used to infer intrinsic brightness from observed flux, always larger than comoving distance), angular diameter distance (the distance inferred from an object's apparent angular size, which can decrease at high z as the universe was smaller when light was emitted), and the distance modulus (the logarithmic measure used for standard candles like Type Ia supernovae). All distances are computed via numerical integration of the Friedmann equation, using 1,000 to 10,000 integration steps depending on the redshift magnitude. Lookback time tells you how long ago the light you are observing was emitted. For example, a galaxy at z = 0.1 is observed as it appeared about 1.3 billion years ago, while the cosmic microwave background at z = 1089 was emitted just 380,000 years after the Big Bang — a lookback time of about 13.8 billion years. The BulletChart visualization shows the lookback time compared to the total age of the universe, giving an intuitive sense of how far back in cosmic history each observation reaches. Spectral line presets allow you to instantly select common spectroscopic reference wavelengths: Lyman-alpha (121.6 nm), H-alpha (656.3 nm), Ca II K and H (393.4 and 396.8 nm), H-beta, OIII, Mg I b, and Na I D. Notable object presets let you explore real astronomical examples: Andromeda (M31, z = −0.001, approaching us), the Virgo and Coma clusters, quasar 3C 273, the distant quasar ULAS J1120+0641 (z = 7.085), and the CMB (z = 1089). The Hubble tension callout highlights the ongoing measurement discrepancy between Planck 2018 (H₀ = 67.4) and local distance ladder measurements like SH0ES/Riess (H₀ = 73.0), one of the most important open questions in modern cosmology.
Understanding Redshift and Cosmological Distances
What Is Redshift?
Redshift (symbol z) is the fractional increase in the wavelength of light as it travels from a source to an observer. It is defined as z = (λ_observed − λ_emitted) / λ_emitted, where λ_emitted is the rest wavelength of a known spectral line and λ_observed is the wavelength measured at Earth. A positive z means the source is receding and the light is shifted toward longer (redder) wavelengths. A negative z (blueshift) means the source is approaching — the only common example in astronomy is the Andromeda Galaxy (M31), which is on a collision course with the Milky Way. Redshift arises from three distinct physical mechanisms: Doppler redshift (relative motion), cosmological redshift (expansion of space), and gravitational redshift (light climbing out of a gravitational potential well). For extragalactic objects, the dominant effect is cosmological redshift due to the expansion of the universe.
How Are Distances Calculated?
Cosmological distances require numerical integration of the Friedmann equation in the ΛCDM model. The key quantity is the comoving radial distance d_C = (c/H₀) × ∫[0 to z] dz' / E(z'), where E(z) = √(Ω_m(1+z)³ + Ω_Λ) is the dimensionless Hubble parameter. From d_C, three other distances follow: luminosity distance d_L = (1+z) × d_C, angular diameter distance d_A = d_C / (1+z), and distance modulus μ = 5 log₁₀(d_L / 10 pc). The recession velocity uses the relativistic Doppler formula v = c × [(1+z)² − 1] / [(1+z)² + 1]. Lookback time requires a second integration: t_L = (1/H₀) × ∫[0 to z] dz' / [(1+z') × E(z')]. This calculator uses Simpson's rule with up to 10,000 steps for high-z objects like the CMB.
Why Does Redshift Matter?
Redshift is the primary distance indicator for extragalactic astronomy and cosmology. Unlike parallax (which is only accurate within a few thousand light-years) or Cepheid variables and Type Ia supernovae (accurate to a few billion light-years), redshift measurements work at cosmic scales extending to the edge of the observable universe. Redshift surveys like SDSS and 2dFGRS have used millions of galaxy redshifts to map the three-dimensional structure of the universe, revealing the cosmic web of filaments, walls, and voids. The redshift of quasars allows astronomers to probe the universe as it was only hundreds of millions of years after the Big Bang. The Hubble constant H₀ — the present expansion rate — is inferred from the linear relationship between redshift and distance at low z, and its precise value has profound implications for the age and fate of the universe.
Limitations and Caveats
This calculator assumes a flat ΛCDM universe with no radiation density (Ω_R ≈ 0, valid for z < 1000) and no curvature (Ω_k = 0). For very high redshifts near the CMB (z ≈ 1089), radiation becomes significant and the simple E(z) formula introduces a small error. The tool does not account for peculiar velocities — the actual motions of galaxies superimposed on the Hubble flow, which can amount to hundreds of km/s for nearby objects. The Hubble tension (the discrepancy between Planck-derived H₀ ≈ 67.4 and local measurements of H₀ ≈ 73) means that distance estimates depend on which cosmological parameters you use. The angular diameter distance decreases for z > 1.6, meaning that very distant objects can appear larger on the sky than moderately distant ones — a counterintuitive consequence of the expanding universe.
Key Redshift and Cosmology Formulas
Redshift Definition
z = (λ_obs − λ_emit) / λ_emit
The fractional shift in wavelength between the observed and emitted light. Positive z indicates redshift (source receding); negative z indicates blueshift (source approaching).
Relativistic Recession Velocity
v = c × [(1+z)² − 1] / [(1+z)² + 1]
The special-relativistic Doppler formula for recession velocity. Unlike the approximation v ≈ cz, this formula gives physically correct results for all values of z, with v always less than c.
Hubble's Law (Low Redshift)
v = H₀ × d
For nearby galaxies (z < 0.1), recession velocity is proportional to distance. H₀ is the Hubble constant in km/s/Mpc. Accurate to <0.5% for z < 0.1.
Comoving Distance (ΛCDM)
d_C = (c/H₀) × ∫₀ᶻ dz' / √(Ω_m(1+z')³ + Ω_Λ)
The proper distance in a co-expanding reference frame, computed by numerical integration of the Friedmann equation. Ω_m is matter density, Ω_Λ is dark energy density.
Redshift Reference Data
Notable Redshifts and Lookback Times
Redshift values, recession velocities, comoving distances, and lookback times for well-known astronomical objects and cosmic epochs (Planck 2018 cosmology).
| Object / Epoch | Redshift (z) | Recession Velocity | Comoving Distance (Gly) | Lookback Time (Gyr) |
|---|---|---|---|---|
| Andromeda Galaxy (M31) | −0.001 | −300 km/s (approaching) | 0.0025 | 0.0025 |
| Virgo Cluster | 0.004 | 1,100 km/s | 0.054 | 0.054 |
| Coma Cluster | 0.023 | 6,900 km/s | 0.31 | 0.31 |
| Quasar 3C 273 | 0.158 | 44,000 km/s | 2.0 | 1.9 |
| Galaxy at z = 1 | 1.0 | 0.6c | 10.8 | 7.7 |
| Most distant galaxy (z ≈ 13) | 13.0 | 0.986c | 33.2 | 13.5 |
| CMB (last scattering) | 1,089 | ≈c | 45.4 | 13.8 |
Cosmological Parameters Comparison
Key parameter values from different measurement campaigns, illustrating the Hubble tension.
| Parameter Set | H₀ (km/s/Mpc) | Ω_m | Ω_Λ | Age of Universe (Gyr) |
|---|---|---|---|---|
| Planck 2018 (CMB) | 67.4 ± 0.5 | 0.315 | 0.685 | 13.80 |
| WMAP 9-year | 69.32 ± 0.80 | 0.286 | 0.714 | 13.77 |
| SH0ES/Riess 2022 (local) | 73.0 ± 1.0 | — | — | ~12.9 (implied) |
| HST Key Project | 72.0 ± 8.0 | — | — | ~13.0 (implied) |
Worked Examples
Recession Velocity for a Galaxy at z = 0.1
An astronomer measures the H-alpha spectral line of a galaxy at 721.9 nm instead of the rest wavelength of 656.3 nm.
Calculate redshift: z = (721.9 − 656.3) / 656.3 = 65.6 / 656.3 = 0.1000
Non-relativistic approximation: v ≈ c × z = 299,792 × 0.1 = 29,979 km/s
Relativistic formula: v = c × [(1.1)² − 1] / [(1.1)² + 1] = c × 0.21/2.21 = 28,487 km/s
Hubble distance: d = v/H₀ = 28,487 / 67.4 = 423 Mpc ≈ 1.38 billion light-years
The galaxy is receding at 28,487 km/s (9.5% of c) at a comoving distance of approximately 1.38 billion light-years, with a lookback time of about 1.3 billion years.
Distance from Redshift for Quasar 3C 273
Quasar 3C 273 has a well-known redshift of z = 0.158. Calculate its cosmological distances using Planck 2018 parameters.
Relativistic velocity: v = c × [(1.158)² − 1] / [(1.158)² + 1] = c × 0.341/2.341 = 43,700 km/s (14.6% of c)
Comoving distance via numerical integration: d_C ≈ 644 Mpc ≈ 2.1 billion light-years
Luminosity distance: d_L = (1 + z) × d_C = 1.158 × 644 = 746 Mpc
Angular diameter distance: d_A = d_C / (1 + z) = 644 / 1.158 = 556 Mpc
Lookback time: ≈ 1.9 billion years
3C 273 is at a comoving distance of 2.1 billion light-years. We see it as it was 1.9 billion years ago — one of the nearest and brightest quasars visible from Earth.
Lookback Time for the Cosmic Microwave Background
The CMB was emitted at z = 1089, when the universe first became transparent to photons. Calculate the lookback time.
Scale factor at emission: a = 1/(1+z) = 1/1090 ≈ 0.000918 — the universe was 0.09% of its current size
Numerical integration of lookback time: t_L = (1/H₀) × ∫ dz'/[(1+z')×E(z')]
Result: t_L ≈ 13.80 billion years
Age of universe at emission: 13.80 − 13.80 ≈ 380,000 years after the Big Bang
The CMB photons have been traveling for 13.8 billion years — nearly the entire age of the universe. They were emitted when the universe was just 380,000 years old and 1,090 times smaller than today.
How to Use the Redshift Calculator
Choose Your Input Mode
Select Wavelength Mode if you have spectroscopic measurements (observed and rest wavelengths), Redshift Mode if you already know the z value from a catalog or database, or Velocity Mode to convert a recession velocity into redshift and distance. Click the mode tab above the calculator to switch.
Enter Your Values
In Wavelength Mode, type the observed wavelength and use the spectral line presets to fill in common rest wavelengths like H-alpha (656.3 nm) or Lyman-alpha (121.6 nm). In Redshift Mode, click an object preset (M31, Coma, CMB) or type any z value. The calculator updates automatically as you type.
Review the Results
The results panel shows the redshift z, recession velocity as a fraction of the speed of light (with a ProgressRing gauge), cosmological distances (comoving, luminosity, and angular diameter) as labeled bars, and a lookback time chart showing how far back in cosmic history you are observing.
Adjust Cosmology and Export
Use the Hubble Constant selector to compare Planck 2018 vs SH0ES values, or expand Advanced Settings to enter custom Ω_m and Ω_Λ values. Once satisfied, click Export CSV to download all calculated quantities, or Print Results to save a printer-friendly copy.
Frequently Asked Questions
What is redshift and how is it different from blueshift?
Redshift (positive z) means the observed wavelength is longer than the emitted wavelength — the light source is moving away from us or the space between us is expanding, stretching the light. Blueshift (negative z) means the source is approaching and the wavelength is compressed toward shorter (bluer) wavelengths. In our cosmic neighborhood, the Andromeda Galaxy (M31) is the most famous example of a blueshifted object at z ≈ −0.001. Most distant galaxies show redshift due to the expansion of the universe. Gravitational redshift, where light climbing out of a gravitational well loses energy, is a third mechanism but is significant mainly for compact objects like neutron stars and black holes.
Can recession velocity exceed the speed of light?
Yes — and this does not violate special relativity. Cosmological recession velocities exceeding the speed of light are common for objects at z > 1.5 or so. The key distinction is that it is space itself expanding between galaxies, not matter moving through space. Special relativity forbids objects from moving faster than light through space, but the metric expansion of space has no such limit. The relativistic Doppler formula used in this calculator gives the component of recession velocity attributable to motion, which always remains less than c. Hubble's Law v = H₀ × d is a useful approximation for low z but should not be extrapolated beyond z ≈ 0.1 without the relativistic correction.
What is the difference between comoving, luminosity, and angular diameter distance?
These three distances answer different physical questions. Comoving radial distance is the proper distance measured in a coordinate system that expands with the universe — it is what you would measure if you could freeze cosmic expansion and lay down a ruler. Luminosity distance is larger than comoving distance by a factor of (1+z) and is used to relate observed flux to intrinsic luminosity; it is what you infer from a standard candle. Angular diameter distance is smaller than comoving distance by (1+z) and tells you how large an object appears; strikingly, for z > about 1.6, it decreases with increasing redshift, so very distant objects can appear larger than moderately distant ones. Distance modulus is the logarithmic luminosity distance used when working with magnitudes.
What is lookback time and how does it relate to the age of the universe?
Lookback time is the time elapsed between when the observed light was emitted and now. For a galaxy at z = 1, the lookback time is roughly 7.7 billion years (depending on cosmological parameters), meaning you are seeing the galaxy as it was 7.7 billion years ago — when the universe was about 6 billion years old. The age of the universe at emission is the total age of the universe minus the lookback time. The total age of the universe (z = 0) with Planck 2018 parameters is approximately 13.8 billion years. The cosmic microwave background at z = 1089 has a lookback time of nearly 13.8 billion years and was emitted just 380,000 years after the Big Bang.
What is the Hubble tension and why does it matter?
The Hubble tension refers to a significant discrepancy between two independent measurements of the present-day Hubble constant H₀. The Planck 2018 analysis of the cosmic microwave background gives H₀ ≈ 67.4 km/s/Mpc, while local distance ladder measurements (e.g., SH0ES, using Cepheid variables and Type Ia supernovae) consistently give H₀ ≈ 73 km/s/Mpc. This ~10% difference has grown to statistical significance above 5σ and cannot be explained by measurement errors. If real, it may indicate new physics beyond the standard ΛCDM model — such as early dark energy, additional radiation species, or modified gravity. The tension directly affects distance and lookback time estimates, so this calculator lets you compare results under both assumptions.
How accurate are the distance and time calculations in this calculator?
The calculations use numerical integration (Simpson's rule) of the Friedmann equation with 1,000 to 10,000 integration steps depending on the redshift. For moderate redshifts (z < 100), accuracy is better than 0.1% compared to analytic or high-precision numerical solutions. For very high redshifts like the CMB (z = 1089), the tool omits the radiation density term (Ω_R ≈ 9×10⁻⁵), which introduces a ~1% error in lookback time near z = 1089. For practical astronomical purposes — matching published values for well-known objects, checking catalog distances, or coursework — the results are reliable to 3–4 significant figures for z < 10 and to 2–3 significant figures near z = 1089.
Related Tools
Hubble Constant Calculator
Calculate the Hubble constant from recession velocity and distance measurements, or estimate distances from redshift.
Parallax Distance Calculator
Convert stellar parallax angles to distances in parsecs and light-years for nearby stars.
Star Magnitude Calculator
Convert between apparent and absolute magnitudes, compute luminosity, and determine stellar distances.
Schwarzschild Radius Calculator
Compute the event horizon radius, surface gravity, and Hawking temperature for any mass.
Delta-V Calculator
Calculate rocket velocity change using the Tsiolkovsky equation with multi-stage support and engine presets.