ForHosting KIT · Science

Redshift calculator

A line emitted at 600 and observed at 660 has a redshift z of 0.1, a recession speed of 29979.2458 km/s. Enter both wavelengths in the same unit and get z, the velocity and every step. 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
Observed wavelength λ_obs
660
Emitted
600
You get
Lambda obs
660
Lambda em
600
Redshift
0.1
Z
0.1

A redshift calculator turns two spectroscopic wavelengths into the dimensionless redshift z and a classical recession velocity. Enter the observed wavelength of a spectral line and the emitted rest wavelength in the same length unit; the tool returns z equals lambda observed minus lambda emitted over lambda emitted, then multiplies by the exact speed of light to give recession speed in metres per second and kilometres per second. Lab students measuring Balmer lines, instructors grading homework, data-pipeline authors, and coding-kata writers all need the same deterministic pair of numbers without opening a spreadsheet.

What spectroscopic redshift means for wavelengths

When a light source moves relative to an observer along the line of sight, or when space expands between emission and detection, spectral lines shift in wavelength. The spectroscopic redshift is defined by the closed formula z equals the observed wavelength minus the emitted rest wavelength, all divided by the emitted wavelength. That single dimensionless number is independent of the unit you chose for wavelength: nanometres, angstroms, or metres all cancel in the ratio, provided both inputs share the same unit.

Positive z means the observed line is longer than the rest line—a redshift often associated with recession or cosmological expansion. Negative z means a blueshift: the observed line is shorter, consistent with approach in a simple Doppler picture. Zero z means the two wavelengths match within rounding, so there is no line shift in this model.

The non-relativistic recession velocity used here is v equals c times z, with c equal to two hundred ninety-nine million seven hundred ninety-two thousand four hundred fifty-eight metres per second, the exact SI vacuum speed of light. That linear map is the standard first homework step; it becomes a poor approximation when absolute z is large, where a relativistic Doppler formula or a full cosmological model is required.

Teachers and automated graders care about the zero-emitted rejection as much as the sign of z: a student who leaves rest wavelength blank or types zero has left the domain of the definition, and a silent fallback would hide that mistake. The check path recomputes the ratio and the product with the same fixed rounding used for published fields, so a successful response always ships with steps you can assert in tests or worksheets.

Practical tips, limits, and related searches

Keep both wavelengths in the same unit before you call; convert angstroms to nanometres in your client if your catalogue mixes units. Prefer sending numbers rather than pre-formatted strings when you control the client; string numbers are accepted only when they match a strict finite numeric pattern.

Classic classroom checks use simple ratios: observed six hundred sixty and emitted six hundred yield z equals zero point one and recession speed three times ten to the seven metres per second; equal wavelengths yield z equals zero; observed shorter than emitted yields a negative z and a negative velocity read as approach. Keep absolute redshift modest if you intend to interpret v equals c z physically: at large z the non-relativistic map exceeds c and is only a formal product, not a valid special-relativistic speed.

This landing targets people searching for a redshift calculator, wavelength redshift formula, or recession velocity from spectral lines online; it is not a Hubble-law distance tool, not a relativistic Doppler solver, not a blackbody peak-shift converter, and not a radio frequency-to-wavelength utility. Prefer this capability when you already have lambda observed and lambda rest and only need z and the classical v equals c z pair; if your source gives frequencies, convert to wavelengths first or use a dedicated frequency tool.

Round-trip checks are easy: recompute observed minus emitted over emitted by hand, multiply by c, divide by one thousand for kilometres per second, and confirm published fields match within the same twelve-decimal rounding.

What is the redshift formula from wavelengths?

z = (λ_obs − λ_em) / λ_em, where λ_obs is the observed wavelength and λ_em is the emitted (rest) wavelength in the same unit. Positive z is a redshift; negative z is a blueshift.

How is recession velocity computed?

Results are returned in m/s and km/s. For large |z| use a relativistic or cosmological model instead.

What happens if the emitted wavelength is zero?

Redshift is undefined when the rest wavelength is zero because the definition divides by λ_em.

Do wavelength units matter?

Only that both values use the same unit. Nanometres, angstroms, or metres all work because the unit cancels in the ratio z.

Is the redshift calculator free?

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/astro/redshift-velocity

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/astro/redshift-velocity \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"observed_wavelength":660,"emitted_wavelength":600}'
{
  "observed_wavelength": 660,
  "emitted_wavelength": 600
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "astro.redshift_velocity",
  "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.

max_abs1000000000000
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.

When the emitted wavelength is zero the ratio is undefined, so the API returns a clear invalid_input error instead of dividing by zero.

How to call the API and what comes back

The emitted wavelength must be non-zero; values whose absolute value is at or below one times ten to the minus fifteen are treated as zero and rejected. Send a JSON body with two required finite numbers: observed_wavelength (aliases lambda_obs, observed, lambda_observed, wavelength_obs) and emitted_wavelength (aliases lambda_em, emitted, lambda_rest, rest_wavelength, wavelength_em). Absolute values must stay within the published limit of one trillion so intermediate ratios and products remain finite in IEEE double precision on the Worker and in the browser. On success the response echoes rounded observed and emitted wavelengths under several alias keys, sets redshift and z to the same dimensionless value, recession_velocity_m_s and v_m_s to c times z in metres per second, recession_velocity_km_s and v_km_s to that speed divided by one thousand, c and speed_of_light to the exact SI constant, formula and velocity_formula to the defining strings, equation to a human-readable substitution line, units to a map of labels, message to a short English summary of redshift versus blueshift, and steps to an ordered array of given-values, formula, substitute, constant, velocity, and summary lines. Failed validation—missing fields, non-finite numbers, values outside absolute limits, non-finite redshift or velocity, or zero emitted wavelength—returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item and zero marginal unit price.

Practical tips, limits, and related searches

Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when learners deliberately set emitted wavelength to zero.

Homework checks for spectral-line redshift

Students enter observed and rest wavelengths from lab spectra and compare hand-written z and v = c·z against a deterministic JSON result before submitting.

Unit tests for astronomy pipeline code

Generate known-good positive, zero, and negative redshift cases plus deliberate zero-emitted rejections for coding kata expected values.

Quick recession-speed estimates in notebooks

Analysts paste catalogue line measurements into the API to attach classical recession velocities without embedding cosmology libraries.

Read the full KIT documentation →