Solar Day Length Calculator
A planet's solar day is the time from one local noon to the next, which is not usually the same as one rotation relative to distant stars.
Run — free
This calculator combines the sidereal rotation period with the orbital period to account for the distance the planet travels around its star during each spin. Enter both periods in one shared unit to obtain the solar day in that same unit. The calculation is deterministic, immediate, and suitable for planets, exoplanets, classroom models, and fictional systems with prograde rotation.
Why a solar day differs from a sidereal rotation
A sidereal rotation period measures how long a planet takes to turn once relative to distant stars. A solar day instead measures how long the star takes to return to the same apparent position in the planet's sky, such as the interval between consecutive local noons. While the planet rotates, it also advances along its orbit. With prograde rotation, that orbital movement means the surface must turn farther than one sidereal revolution before the star crosses the same meridian again. The calculator accounts for both motions rather than treating a rotation as a complete day. This distinction is small for a rapidly spinning planet with a long year, but it becomes large when the rotation and orbital periods approach one another. Use periods stated in the same unit. Hours are convenient for Earth-like worlds, days often suit slower rotators, and years may be clearer for very long cycles. The returned value keeps the selected unit, so no hidden conversion changes the scale of your result.
How the calculator combines the two periods
For prograde motion, the apparent angular rate of the star is the difference between the planet's rotational rate and its orbital rate. Writing those rates as reciprocals gives the relation one over the solar day equals the absolute value of one over the sidereal period minus one over the orbital period. The calculator evaluates the equivalent stable expression: sidereal period multiplied by orbital period, divided by the absolute difference between them. The absolute value reports a positive duration even when the numerical ordering of the two periods would reverse the apparent direction of the star across the sky. Both inputs must be finite numbers greater than zero. They must also describe the same unit; entering one value in hours and the other in days would produce a meaningless result. When the periods are exactly equal, their angular rates cancel. The star then remains fixed at one longitude in this idealized model, so no finite solar day exists and the calculator returns an input error instead of infinity.
Interpreting results and understanding the model
Read the result as the duration of the mean solar cycle in an idealized uniform system. For Earth, using a sidereal rotation just under twenty-four hours and an orbital period near one year produces a solar day close to twenty-four hours. A body near synchronous rotation produces a much larger value because the star moves only slowly through its sky. This calculation assumes a constant sidereal rotation rate, a constant mean orbital rate, and prograde motion expressed through unsigned periods. It does not model seasonal changes in apparent solar time caused by orbital eccentricity, axial tilt, precession, libration, atmospheric refraction, or changes in rotation. It also does not infer whether a planet rotates retrograde from a positive period alone. For a precision ephemeris or a retrograde body, use signed angular velocities and time-dependent orbital data instead. For comparisons, education, initial exoplanet characterization, and world-building, the mean relation is often the useful first answer because it isolates the core interaction between spin and orbit without requiring observational tables or network access.
What you can do with it
Compare planetary time scales
Convert published sidereal rotation and orbital periods into comparable mean solar-day durations.
Explore near-synchronous rotation
See how the apparent day grows as a planet's spin period approaches its orbital period.
Design a fictional planetary system
Choose consistent spin and orbit periods, then calculate the daylight cycle inhabitants would experience.
FAQ
What does the API calculation cost?
Each API request costs $0.002. The same deterministic calculation can also run free in your browser.
What is the difference between a sidereal day and a solar day?
A sidereal day is one rotation relative to distant stars; a solar day is the interval for the host star to return to the same apparent sky position.
Why must both periods use the same unit?
The formula subtracts their reciprocal rates. A shared unit is necessary for those rates and the resulting duration to be consistent.
Why are equal periods rejected?
Equal prograde spin and orbital periods make the apparent stellar rate zero in this model, so the solar day has no finite length.
Does this calculator support retrograde rotation?
Not explicitly. Its inputs are unsigned positive periods and its formula models the magnitude of the prograde synodic relation. Retrograde systems require signed angular rates.
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/solar-day-length \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"sidereal_rotation_period":23.9344696,"orbital_period":8765.8128}'const res = await fetch("https://api.kit.forhosting.com/astro/solar-day-length", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"sidereal_rotation_period": 23.9344696,
"orbital_period": 8765.8128
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/astro/solar-day-length",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"sidereal_rotation_period": 23.9344696,
"orbital_period": 8765.8128
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/astro/solar-day-length", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"sidereal_rotation_period":23.9344696,"orbital_period":8765.8128}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"sidereal_rotation_period":23.9344696,"orbital_period":8765.8128}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/astro/solar-day-length", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"sidereal_rotation_period": 23.9344696,
"orbital_period": 8765.8128
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "astro.solar_day_length",
"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. |