Light travel time calculator
Find how long light needs to cover a distance in space: one astronomical unit takes about 499 seconds, the familiar eight-minute delay of sunlight. Enter kilometres or astronomical units. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Distance
- 149,597,870.7 km
- Distance m
- 149,597,870,700 km
- Distance km
- 149,597,870.7
- Distance au
- 1
- Seconds
- 499.0047838362
This light travel time calculator returns how long a vacuum light signal takes to cross a given path length. The closed form is fully deterministic: travel time t equals distance d divided by the exact SI speed of light c equals 299792458 metres per second. Enter distance in kilometres or in astronomical units; the engine converts to metres using the IAU 2012 definition of one AU as exactly 149597870700 metres, then divides by c. A classic check is one astronomical unit, which yields about 499 seconds or roughly eight point three minutes—the familiar light-time lag between Earth and the Sun at mean distance. Another check is 299792.458 kilometres, which is exactly one light-second. The engine uses only finite arithmetic with no network calls, no sampling, and no date-dependent shortcuts.
What light travel time means and what you get
Light travel time is the one-way duration a photon or ideal electromagnetic signal would take to traverse a straight vacuum path of length d at the fixed speed of light. In SI units the speed is exact by definition: c equals 299792458 metres per second, so the only modelling choice is how you express the path length. This calculator accepts kilometres or astronomical units, converts the length into metres, and returns t equals d over c in seconds.
The response also mirrors that duration into minutes, hours, days, and Julian years using fixed second counts so educational displays stay stable, and it echoes the path length in metres, kilometres, and astronomical units so you can cross-check unit conversions without a second tool. Zero distance is allowed and simply yields zero travel time.
Where light travel time fits in study, astronomy, and software
Students meet light travel time when a textbook moves from the definition of the speed of light to communication delays across the Solar System, when a contest problem asks how long a signal takes to reach a probe at a given distance, or when they convert light-minutes into kilometres without calculus. Teachers can pre-generate answer keys for modest kilometre and AU values without trusting opaque calculator apps that silently switch units or drop scientific notation.
Developers call the same contract from scripts to seed deterministic test vectors for space-game signal lag, to normalize user-entered distances before mission-planning demos, or to satisfy programming-challenge statements that demand t rather than a hand-waved eight-minute Sun lag. Contest practice often needs a fast, offline source of light times so solutions can be checked without graphing calculators under time pressure. Product and education tools use the formula when a learner types a probe distance and the UI must show seconds and minutes next to a light-cone diagram.
What you can do with it
Homework and Solar System light lags
Compute one-way light time from textbook distances in km or AU and verify seconds before communication-delay problems.
Mission demos and game physics
Normalize user-entered path lengths into light travel time for probe links, exoplanet demos, and space games.
FAQ
What does the light travel time calculator cost?
It is free in your browser on this page.
What happens if distance is negative?
Light travel time t = d/c is undefined for a negative path length.
Does this include atmosphere, gravity, or round-trip delay?
No. It returns pure one-way vacuum light time. Refractive media, Shapiro delay, and 2d/c radar delay are out of scope.
Why are results rounded to a precision?
Default precision is 10 decimal places; you can set precision from 0 to 15.
How long does sunlight take to reach Earth?
About 499 seconds, a little over eight minutes, at the mean Earth–Sun distance of one astronomical unit. Enter 1 in astronomical units or 149,597,870.7 km to see it.
Related tools
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/light-travel-time \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"distance":149597870.7}'const res = await fetch("https://api.kit.forhosting.com/astro/light-travel-time", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"distance": 149597870.7
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/astro/light-travel-time",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"distance": 149597870.7
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/astro/light-travel-time", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"distance":149597870.7}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"distance":149597870.7}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/astro/light-travel-time", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"distance": 149597870.7
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "astro.light_travel_time",
"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.
Limits
max_abs_distance | 1e+30 |
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. |
Technical notes
What light travel time means and what the response contains
You also receive the fixed constants c and au_m used in the product, a unit_time tag of s, the method tag light_travel_time, the precision applied, and a short formula reminder. There is no approximate integrator and no random sampling of media refractive index: the engine either builds exact floating-point t inside the supported magnitude range or rejects the input with invalid_input. Rejected cases include missing distance, non-finite values, magnitudes above the documented ceiling, and any negative path length, because a negative distance is non-physical for one-way light travel in this model.
How distance and unit are read and how t stays reproducible
Optional leading plus signs and scientific notation on numeric strings are allowed when they parse as finite decimals; embedded spaces, hex prefixes, and non-numeric tokens are rejected with a clear message so a bad cell does not become a wrong light time. The preferred field is distance for the path length, but aliases d, dist, and length are accepted so spreadsheets, query strings, and typed forms can reuse the same contract. Optional field unit selects kilometres or astronomical units; aliases units and distance_unit are accepted, and the default is km when the field is omitted. Recognised kilometre tokens include km, kilometres, and kilometers; recognised AU tokens include au, AU, and astronomical_units. Distance must not be negative: if distance is less than zero or negative zero, the request fails with invalid_input because light travel time t equals d over c is undefined for a negative path length. An optional precision field, with aliases decimals and dp, chooses how many decimal places to expose for distance and time fields, defaulting to ten and capped at fifteen so JSON goldens stay stable. Pair the free browser run on this page with the priced API when you need the identical mathematical result inside an automated pipeline without re-implementing the light-time formula yourself.
Where light travel time fits in study, astronomy, and software
On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split — free interactive exploration and a priced, identical API — matches the rest of the KIT tier-A catalog and lets you move from a classroom demo to an automated pipeline without changing the mathematical result. Pair it with surface-gravity or other astronomy endpoints when you are building a small lab of free, deterministic science helpers, and keep light travel time as the dedicated answer when the search intent is how long light takes to cross a distance.
Integration use cases
Deterministic test fixtures
Generate reproducible t = d/c values for unit tests, property checks, and CI assertions on signal-delay modules.
Technical questions
How is light travel time defined here?
One-way vacuum time t = d/c with c = 299792458 m/s (exact SI). Distance may be in kilometres or astronomical units (IAU AU = 149597870700 m).