Cosmology Calculator

A modern, interactive tool for cosmological distances, lookback times, ages, and observational quantities. Supports curvature, dark energy equation of state, batch processing, and reverse lookups.

01 — Cosmological Model Live updates as you adjust parameters
Cosmology preset
Hubble Constant H₀ km/s/Mpc
Matter Density ΩM
Vacuum Energy ΩΛ
Curvature ΩK flat
auto: 1 − Ωᵐ − ΩΛ
Dark Energy EoS w
Redshift z₁ (observer)
Redshift z₂ (target)
02 — Expansion at z₂
E(z₂)
H(z₂) km/s/Mpc
Hubble distance Dᵀ Mpc
Hubble time tᵀ Gyr
03 — Standard Distances (Earth → z₂)
Comoving DC Mpc Gly
Transverse DM Mpc
Angular Diameter DA Mpc Gly
Luminosity DL Mpc Gly
Light Travel Distance Mpc Gly
Comoving Volume VC Gpc³
04 — Times
Age of Universe today (t₀) Gyr
Lookback Time to z₂ Gyr
Age of Universe at z₂ Gyr
Lookback / t₀ %
05 — Observational Quantities
Physical Scale kpc/arcsec
Distance Modulus μ mag
Surface Brightness Dimming ×
CMB Temperature at z₂ K
06 — Relative Distances (z₁ → z₂) Set z₁ > 0 to view
DC(z₁,z₂) Mpc
DM(z₁,z₂) Mpc
DA(z₁,z₂) Mpc
DL(z₁,z₂) Mpc
07 — Share & Export
A — Energy Budget at z = 0 Friedmann constraint: ΩM + ΩΛ + ΩK = 1
B — Hubble Diagram — DL(z)

Luminosity distance vs redshift. Amber marker is your current z₂.

C — Distance Modulus μ(z)

μ = 5 log₁₀(DL/Mpc) + 25. Standard SN Ia plotting space.

D — Scale Factor a(t)

Size of the universe vs cosmic time. Markers show today (a = 1) and the epoch of z₂.

E — Lookback Time tL(z)

Time light has been travelling from each redshift. Approaches t₀ as z → ∞.

Looking for the spacetime diagram?

The Davis & Lineweaver-style spacetime diagram (past/future light cones, particle horizon, event horizon, Hubble sphere, comoving worldlines) now lives in its own dedicated tool so it has the room it deserves.

Open Spacetime Diagram
A — Batch Redshifts

Paste a column of redshifts (one per line, or comma-separated). The current cosmological model in the Calculator tab is used. Output uses km/s/Mpc, Mpc, and Gyr.

A — Reverse Lookup (find z)

Uses bisection on the current cosmological model from the Calculator tab.

B — Wavelength Converter

λobs = λemit × (1 + z). Edit either field; the other updates. Uses z₂ from Calculator.

Emitted (rest-frame) λemit
Observed λobs
C — Method

The expansion history is a flat- or curved-space wCDM model with constant dark-energy equation of state. All integrals are computed in the browser with composite Simpson's rule; reverse lookups use bisection. Sub-second performance for the full Calculator panel.

Numerical methods
  • Comoving distance & lookback: Simpson's rule, n = 1000.
  • Lookback substitution: u = ln(1+z) for stability at high z.
  • Age of the universe: u = ln(a) substitution over a ∈ [10−11, 1].
  • Reverse lookups: bisection, tolerance 10−5.
  • Visualisations: 60–80 sample points per curve, recomputed live.
Distance formulas
  • Comoving: DC(z) = (c/H₀) ∫ dz'/E(z').
  • Transverse: sinh / linear / sin in DC, by sign of ΩK.
  • Angular diameter: DA = DM / (1+z).
  • Luminosity: DL = DM · (1+z).
  • Relative DM(z1, z2): Hogg 1999, Eq. 19.
  • Comoving volume: closed form per curvature (Hogg 1999, Eq. 29).
Constants used
c299 792.458 km/s
TCMB,02.7255 K
1 Gly306.601 Mpc
1/H₀977.792 / H₀ Gyr
1 pc3.0857 × 1013 km
1 Gyr3.1557 × 1016 s
Limitations
  • No radiation term: ΩR is omitted (subdominant for z << 1000; relevant only near recombination).
  • Constant w only: the DESI Y1 evolving dark-energy hint uses the CPL parameterisation w(z) = w0 + wa z/(1+z); this engine treats w as a constant. Setting w = w0 recovers the "today" value but not the time evolution.
  • Fixed CMB temperature: TCMB,0 is hard-coded at 2.7255 K (Fixsen 2009).
  • Privacy: all computation runs locally in your browser. No data leaves your machine.
D — References
Distance formulas Hogg 1999 Distance measures in cosmology. The canonical reference; every distance formula in this calculator (including the Eq. 19 curvature correction for relative DM) is from this paper. arXiv:astro-ph/9905116
Pedagogical Wright 2006 A cosmology calculator for the world wide web. The original web cosmology calculator that inspired the genre; useful cross-check for distance values. arXiv:astro-ph/0609593
CMB — Planck 2018 Aghanim et al. 2020 Planck 2018 results. VI. Cosmological parameters. Source of the Planck 2018 preset. arXiv:1807.06209
CMB — WMAP9 Hinshaw et al. 2013 Nine-year WMAP observations: cosmological parameter results. Source of the WMAP9 preset. arXiv:1212.5226
SN Ia — Pantheon+ Brout et al. 2022 Pantheon+ analysis: cosmological constraints from 1701 SN Ia light curves anchored by SH0ES. Late-universe / high-H₀ reference. arXiv:2202.04077
SN Ia — SH0ES Riess et al. 2022 A comprehensive measurement of the local value of the Hubble constant: H₀ = 73.04 ± 1.04 km/s/Mpc. arXiv:2112.04510
SN Ia — DES SN5YR Vincenzi et al. 2024 The Dark Energy Survey Supernova Programme: cosmological analysis and systematic uncertainties. Source of the DES SN5YR preset. arXiv:2401.02929
BAO — DESI Y1 Adame et al. (DESI) 2024 DESI 2024 cosmological constraints from BAO measurements. ΛCDM and w₀wₐCDM joint fits with CMB and SN. arXiv:2404.03002
CMB temperature Fixsen 2009 The temperature of the cosmic microwave background: TCMB,0 = 2.7255 ± 0.0006 K. Used in the TCMB(z) output. arXiv:0911.1955