ForHosting KIT · Science

Hubble's law calculator

A galaxy 100 megaparsecs away recedes at 7000 km/s when the Hubble constant is 70 km/s per megaparsec. Try values between 67 and 74 to see how the speed shifts, with a rough redshift shown alongside. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Distance
100
Hubble constant
70
You get
Velocity
7,000
Redshift approx
0.0233494867
C km s
299,792.458

Hubble's law is the linear Hubble–Lemaître relation that links how far a galaxy is to how fast it appears to recede in the expanding universe. In textbook form the recessional velocity is v equals H0 times d: multiply the Hubble constant by the galaxy distance and you recover a speed in kilometres per second when d is in megaparsecs and H0 is in kilometres per second per megaparsec.

How Hubble's law computes recessional velocity from distance

Start from the classical Hubble–Lemaître relation: the recessional velocity of a distant galaxy is approximately proportional to its distance, written v equals H0 times d. The constant of proportionality H0 is the Hubble constant at the present epoch; modern determinations typically fall near sixty-seven to seventy-four kilometres per second per megaparsec depending on the probe, but homework sets and lab manuals often fix a single reference value such as seventy.

Distance must be a finite non-negative number because a negative megaparsec distance is not a physical galaxy position under this linear Hubble flow; negative d fails with invalid input instead of silently returning a negative speed that a grader might treat as a blueshift. Zero distance is allowed and yields zero velocity, which is the observer's own location. Hubble constant may be any finite number so you can sweep Planck-era, SH0ES-era, or textbook values against the same catalogue of distances.

Keep units consistent: when d is in megaparsecs and H0 is in kilometres per second per megaparsec, v is in kilometres per second—the unit this page reports as the primary result. This landing intentionally uses the linear low-redshift approximation only; full Friedmann–Lemaître–Robertson–Walker integrals that depend on matter and dark-energy densities, peculiar-velocity corrections, and luminosity-distance curves are separate search intents and separate landings. The inverse problem of recovering distance from a measured recession velocity is a different query and a different calculator.

Where a Hubble's-law velocity calculator earns its keep

Secondary-school and introductory university astronomy courses assign Hubble-diagram drills, Virgo-cluster recession-speed estimates, and order-of-magnitude checks that rearrange the same formula; a single trusted oracle speeds grading and demo setup. Science communicators convert tabulated megaparsec distances into kilometres-per-second recession speeds for public displays without re-deriving unit conversions each time. Data pipelines that pre-filter nearby-galaxy catalogues sometimes need a deterministic linear Hubble-flow velocity column before heavier cosmological modules run.

Research notebooks comparing sensitivity to H0 can hold distances fixed and sweep several constant values to show how predicted recession speeds scale before full cosmology codes. If you later need distance from a measured recession velocity, luminosity distance from spectroscopic redshift under a full ΛCDM cosmology, angular-diameter distance, or lookback-time integrals, treat those as separate search intents and landings rather than overloading this Hubble's law velocity page.

Keep requests in the documented unit pair end to end, convert light-years or h-parameter forms into megaparsecs and kilometres per second per megaparsec before calling, and pin the velocity value in tests so homework checks, LMS plugins, and edge workers stay reproducible without standing up a cosmology solver of your own.

Homework and exam answer keys

Compute v = H0 × d for textbook galaxy distances and a fixed Hubble constant so students and auto-graders share one closed-form ground truth in kilometres per second.

Planetarium and outreach demos

Turn catalogue megaparsec distances into human-readable recession speeds for exhibits and classroom widgets without re-deriving Hubble's law by hand.

H0 sensitivity sweeps

Hold galaxy distances fixed and vary H0 across modern estimate ranges to show how linear Hubble-flow velocities scale before full cosmology codes.

What formula does this Hubble's law calculator use?

The classical linear Hubble–Lemaître relation v = H0 × d. With distance in megaparsecs and H0 in km/s/Mpc, recessional velocity is returned in kilometres per second, plus a low-z convenience field z ≈ v/c.

What happens if the distance is negative?

Hubble's law v = H0 × d yields recessional velocity only for a non-negative galaxy distance; a negative d is never turned into a silent negative speed.

Which units should I use for distance and H0?

Use megaparsecs for distance and kilometres per second per megaparsec for the Hubble constant. Then velocity is in km/s.

Is this a full cosmological redshift solver?

No. It is the linear low-redshift Hubble-law approximation only. Full FLRW luminosity or comoving distances that depend on Ωm and ΩΛ are a different problem and a different landing.

What does the Hubble's law calculator cost?

The browser tool is free and runs locally.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/phys/hubbles-law

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/phys/hubbles-law \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"distance":100,"hubble_constant":70}'
{
  "distance": 100,
  "hubble_constant": 70
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "phys.hubbles_law",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

How Hubble's law computes recessional velocity from distance

This calculator evaluates the closed form v equals H0 times d in deterministic floating-point arithmetic: no random seeds, no wall-clock timestamps, no network calls, and no model drift, so identical inputs always produce identical JSON.

What you send, what you get back, and when the request fails

A negative distance fails with a clear message that distance must not be negative—those failures are not billed. Classic textbook checks include one hundred megaparsecs at seventy kilometres per second per megaparsec recovering seven thousand kilometres per second, and fifty megaparsecs at the same H0 recovering three thousand five hundred kilometres per second. Send two required finite numbers under the fields distance and hubble_constant. Distance is the galaxy distance d, typically in megaparsecs; aliases d and distance_mpc are accepted so notebooks map without renaming columns. Hubble constant is H0 in kilometres per second per megaparsec in the usual convention, for example seventy for many textbook drills or sixty-seven point four for a Planck-era reference; aliases H0, h0, and hubble are accepted. Missing fields, non-numeric strings, NaN, and Infinity fail with invalid_input naming the field and are not charged. On success the response echoes cleaned distance and hubble_constant, returns velocity as the primary result in kilometres per second under that unit convention, redshift_approx as v over c for a classical low-z check, exposes c_km_s as the fixed speed of light used for the redshift approximation, includes a units hint object, and sets formula to v equals H0 times d and method to hubbles_law for honest scope. Pricing for successful API calls is the published base of $0.002 per item; validation failures do not consume prepaid balance. Pair the response with your own cosmological integrator if you next need luminosity distance from redshift under a full ΛCDM model; this endpoint computes the linear Hubble-law velocity only and does not emit plots, Hubble diagrams, or peculiar-velocity corrections.

Where a Hubble's-law velocity calculator earns its keep

Because this capability is a pure parse engine, API pricing is the published base of $0.002 per successful item and failed validation does not consume balance.

Read the full KIT documentation →