A little help goes a long way. Find a tool/

Time FIELD NOTES · 4 MIN READ

How Sunrise and Sunset Are Calculated

The solar geometry behind sunrise times: declination, the equation of time, refraction, and why polar day breaks the rules.

Two cities on the same line of latitude can watch the sun set half an hour apart, and one city in June can skip sunset entirely. Sunrise times look like table trivia, but they are the output of a small, beautiful piece of orbital mechanics — the same handful of equations almanacs have published for centuries, and that the Sunrise & Sunset Calculator runs in your browser.

Two clocks: the orbit and the spin

Earth orbits the sun once a year while spinning once a day, and its spin axis is tilted 23.44° from the orbit. The tilt is why the sun's daily path changes through the year: in June the northern hemisphere leans sunward and the sun climbs higher and stays up longer; in December the opposite. The number that captures this is the declination — the sun's angle north or south of the equator, sweeping between +23.44° at the June solstice and −23.44° at the December solstice, through zero at each equinox.

The equation of time: when clocks disagree with the sun

The second ingredient is less famous. A "solar day" — noon to noon by the sun — is not exactly 24 hours, because Earth's tilted, slightly elliptical orbit makes the sun's apparent speed change through the year. Clocks run uniformly, so the true sun runs ahead of clock time in some seasons and behind it in others. The difference is the equation of time, a swing of about −14 minutes in February to +16 in November. It is why the earliest sunset at mid-northern latitudes happens in early December, weeks before the solstice, while the latest sunrise lags into early January — the two effects pull in opposite directions.

From declination to a clock time

With declination and the equation of time in hand, the rest is geometry. Solar noon at your longitude is the moment the sun crosses your north–south meridian; in UTC minutes it is simply 720 − 4 × longitude − equation-of-time, so a place at 74° west sees solar noon about five hours after Greenwich's. Sunrise and sunset happen when the sun's centre stands at a specific angle from the zenith, solved by the hour angle formula — a cosine equation mixing your latitude, the day's declination and a horizon allowance:

cos(hour angle) = cos(90.833°) / (cos(lat) × cos(decl))
                  − tan(lat) × tan(decl)

That odd 90.833° is 90° plus 0.833°, the standard allowance for two physical effects: atmospheric refraction lifts the sun's image by about 0.567° at the horizon, and sunrise is conventionally the top edge of the disc appearing, not the centre — another 0.266°. Without the allowance, equinox day length would come out as exactly 12 hours; with it, even an equator-side observer gets about 12 hours 7 minutes.

Twilight, and where the math bends

The same formula produces the twilight bands by changing the threshold angle. Civil twilight — bright enough for most outdoor activity, and a legal boundary for vehicle lights — runs while the sun is within 6° below the horizon, so the calculator reruns the equation at 96°; beyond that lie nautical (−12°) and astronomical (−18°) twilight, where the sky is properly dark. The formula also degrades gracefully at the extremes. Near the poles in summer the cosine escapes its valid range in one direction: the sun never sets — the midnight sun of Arctic Circle summers. In winter it escapes the other way — polar night — and yet twilight survives: at Svalbard in early February the sun stays below the horizon all day but comes within 6° of it, so a real, measurable civil noon exists weeks before "sunrise".

Why your wall clock and the sun disagree

None of these instants know about time zones. The math produces instants; labels like "6:59 AM" come from converting an instant through a zone offset, and zone rules — fixed offsets, daylight saving shifts, half-hour zones — are human additions layered on top (the machinery is covered in how time zones work). This is also why solar noon rarely lands on 12:00 by the clock: it is your longitude's position inside the zone plus the equation of time on that date. One honest limitation applies to every table, including almanacs: they assume a sea-level horizon, so a mountain wall can hold back the visible sunrise several minutes past the calculated one.

Try it yourself

Open the Sunrise & Sunset Calculator and enter your coordinates for today, then compare the day length with the same latitude on the equinox. Push the latitude to 69° with a June date and watch the tool report "sun up all day"; set December and watch it flip to polar night while civil twilight persists. Finally, set the display to UTC and slide the longitude to watch solar noon move.

Frequently asked questions

Why is sunrise not exactly 12 hours before sunset?
Because "day" at the horizon is longer than half the daylight circle: atmospheric refraction lifts the sun's image by about 0.567° and you see the top of the solar disc, not its centre. Almanacs fold both into a single 0.833° allowance, which adds several minutes of daylight to each end of the day.
What is the equation of time in simple terms?
The difference between the sun-driven solar day and the uniform 24-hour clock day, caused by Earth's tilted axis and slightly elliptical orbit. It swings between about −14 minutes (February) and +16 minutes (November), which is why solar noon drifts against clock noon through the year.
How far north do you need to go for the midnight sun?
The Arctic Circle at 66.56°N marks the boundary: above it, the sun stays up for at least one full day around the summer solstice (and never rises for at least one day around the winter solstice). The exact boundary wobbles slightly with atmospheric refraction and elevation.
Do sunrise tables account for my altitude or mountains?
No — standard tables, including the NOAA math used by most calculators, assume a sea-level horizon. At high altitude the visible horizon drops and real sunrise comes earlier; mountains can delay the visible sunrise by several minutes compared with the almanac time.