Radial Velocity from Doppler Shift Calculator
This radial velocity calculator converts the shift of a spectral line into line-of-sight velocity using the non-relativistic Doppler approximation.
Run — free
Enter an observed wavelength and the corresponding laboratory rest wavelength in the same unit. The result includes velocity in meters per second and kilometers per second, along with the absolute and fractional wavelength shifts. A positive result indicates redshift and recession, while a negative result indicates blueshift and approach. It is designed for quick astronomy checks where the measured speed is small compared with the speed of light.
Choose matching observed and rest wavelengths
Start with a spectral feature that you can identify reliably in both the measured spectrum and a laboratory reference. Enter its observed central wavelength as observed_wavelength and its unshifted laboratory value as rest_wavelength. Both numbers must use the same wavelength unit. Nanometers, angstroms, micrometers, or meters all work because the calculation uses their ratio, but mixing units produces a meaningless velocity. The rest wavelength must be strictly positive, and both inputs must be finite numbers. For the best scientific result, derive the observed line center from a fitted profile rather than selecting a single noisy pixel. Also check whether the quoted laboratory wavelength is measured in air or vacuum, since combining an air wavelength with a vacuum measurement introduces a systematic offset. This calculator treats the submitted values as exact inputs; it does not estimate measurement uncertainty, resolve blended features, or correct the spectrum for instrumental calibration. Those preparation steps belong in the data-reduction workflow before the two wavelengths are supplied here.
Understand the Doppler calculation and its sign
The calculator first finds the wavelength shift by subtracting the rest wavelength from the observed wavelength. It then divides that shift by the rest wavelength to obtain the dimensionless fractional shift, often written as z for small velocities. Finally, it multiplies the fraction by the exact speed of light, 299,792,458 meters per second. The implemented relation is v = c times (observed wavelength minus rest wavelength) divided by rest wavelength. When the observed wavelength is longer, the shift and velocity are positive: the source is redshifted and receding along the line of sight. When it is shorter, both are negative: the source is blueshifted and approaching. Equal wavelengths return zero velocity. The result is radial velocity only, meaning the component directed toward or away from the observer. It says nothing about motion across the sky. Output includes meters per second for precision, kilometers per second for familiar astronomical reporting, and both intermediate shifts so the calculation can be checked or recorded.
Know when the non-relativistic approximation is appropriate
This capability deliberately uses the classical, non-relativistic Doppler formula. It is useful when the magnitude of the radial velocity is small relative to the speed of light, which covers many stellar, planetary, binary-star, and nearby-galaxy measurements. As the fractional wavelength shift grows, the classical approximation increasingly differs from the special-relativistic Doppler relation. For high-velocity jets, quasars, distant galaxies, or any case where relativistic accuracy matters, use a relativistic calculation and consider the appropriate cosmological redshift model instead. The number returned here is also only as reliable as the wavelength calibration and line identification. Earth’s rotation and orbit, observatory location, source coordinates, observation time, gravitational shifts, and motion relative to a chosen reference frame can all require separate corrections. No barycentric, heliocentric, or local-standard-of-rest correction is applied. Treat the output as the direct velocity implied by the two submitted wavelengths under the stated approximation. For automated use, the same deterministic calculation is available through the API for $0.002 per request.
What you can do with it
Check a stellar absorption line
Convert the measured displacement of an identified stellar line into a signed line-of-sight velocity for a quick spectrum review.
Compare repeated observations
Calculate radial velocities from the same feature at several epochs to inspect possible orbital or pulsational changes.
Validate a spectroscopy pipeline
Use known wavelength pairs as deterministic test cases for software that extracts or reports classical Doppler velocities.
FAQ
Which wavelength units can I use?
Any consistent unit works, including angstroms, nanometers, micrometers, or meters. Both wavelength inputs must use the same unit.
What does a positive velocity mean?
A positive velocity means the observed wavelength is longer than the rest wavelength, indicating redshift and recession under the adopted sign convention.
What does a negative velocity mean?
A negative velocity means the observed wavelength is shorter than the rest wavelength, indicating blueshift and approach.
Does this calculator use the relativistic Doppler formula?
No. It uses the non-relativistic approximation and is intended for speeds that are small compared with the speed of light.
Does it apply barycentric or heliocentric corrections?
No. It calculates only the direct shift implied by the two wavelengths. Reference-frame and observatory-motion corrections must be applied separately.
For developers — API access
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.
API endpoint
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.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/astro/radial-velocity-doppler \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"observed_wavelength":656.5,"rest_wavelength":656.28}'const res = await fetch("https://api.kit.forhosting.com/astro/radial-velocity-doppler", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"observed_wavelength": 656.5,
"rest_wavelength": 656.28
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/astro/radial-velocity-doppler",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"observed_wavelength": 656.5,
"rest_wavelength": 656.28
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/astro/radial-velocity-doppler", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"observed_wavelength":656.5,"rest_wavelength":656.28}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"observed_wavelength":656.5,"rest_wavelength":656.28}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/astro/radial-velocity-doppler", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"observed_wavelength": 656.5,
"rest_wavelength": 656.28
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "astro.radial_velocity_doppler",
"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.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |