Sunrise and Sunset, Explained
After reading this you will know how sunrise, sunset, solar noon and twilight are defined, how the NOAA algorithm computes them from a date and a location, and how to read the results without being tripped up by time zones or the poles.
Sunrise is not the moment the center of the sun crosses the horizon. It is the moment the upper edge of the sun first appears, and the standard also folds in the way the atmosphere bends light. Those two adjustments push sunrise earlier and sunset later than a naive geometry would suggest. On a clear day at 40 degrees north near the equinox, that difference is roughly four to five minutes at each end, so it adds about nine minutes to the day.
The tool computes these times for any latitude, longitude and date using the NOAA solar position algorithm. It is accurate to about a minute for locations away from the polar circles. This guide explains what the numbers mean and how the math produces them.
What the tool computes and when to use it
For a given place and calendar day, the tool reports five quantities: sunrise, solar noon, sunset, day length and civil twilight (the beginning of dawn and the end of dusk). Solar noon is the instant the sun is highest, halfway between sunrise and sunset. Day length is simply sunset minus sunrise.
Use it for planning: photography timing, garden light, when a rooftop loses direct sun, or how much daylight you get for a hike in December versus June. It answers "when will it be light enough to see" through civil twilight, which is when the sun is 6 degrees below the horizon and there is still enough scattered light for most outdoor activity.
The tool models the sun as seen from an ideal sea-level horizon. It does not know about mountains to your east, tall buildings, or your elevation. A ridge on the horizon can delay the visible sunrise by many minutes beyond the computed time.
Do not use these times as legal sunset for aviation, hunting seasons or religious observance without checking the governing authority's own tables. Those sometimes use slightly different definitions or rounding.
The geometry behind the times
Every sunrise time comes from one equation: the hour angle at which the sun reaches a chosen altitude. The sun's altitude h above the horizon depends on your latitude \phi, the sun's declination \delta (how far north or south the sun is that day), and the hour angle H (how far the earth has turned from solar noon).
Here h is the sun's altitude, \phi is your latitude (positive north), \delta is the solar declination for that date (between -23.44^\circ and +23.44^\circ), and H is the hour angle, which is 0 at solar noon and increases by 15 degrees per hour.
Sunrise is when the geometric center of the sun sits at h = -0.833^\circ. That value is not zero for a reason. It combines the sun's angular radius (about 0.267^\circ, so the top edge touches the horizon while the center is that far below) and average atmospheric refraction near the horizon (about 0.567^\circ, which lifts the apparent sun). Add them and you get roughly 0.833^\circ below the true horizon.
Solve the equation for H at that altitude:
The result H is the half-day arc in degrees. Divide by 15 to get hours from solar noon. Sunset is solar noon plus that many hours, sunrise is solar noon minus it. Civil twilight uses the same equation with h = -6^\circ instead of -0.833^\circ.
When \cos H comes out greater than 1, no solution exists: the sun never drops to that altitude, so it never sets (polar day). When it comes out less than -1, the sun never rises to that altitude (polar night). The tool checks for both.
Finding solar noon and declination
Solar noon is not 12:00 on your clock. Two shifts move it. First, your longitude offset from the center of your time zone: each degree east of the zone meridian pulls solar noon four minutes earlier. Second, the equation of time, a wobble caused by the earth's elliptical orbit and its tilted axis. It ranges from about -14 minutes in mid-February to about +16 minutes in early November.
Here \lambda is your longitude, \lambda_{tz} is your time zone's central meridian in degrees, and E is the equation of time in minutes. The algorithm computes \delta and E from the day number using the standard NOAA trigonometric series, which is why the answers hold to about a minute.
A worked example you can reproduce
The default location and date
Take a place at latitude 40^\circ north, longitude 105^\circ west, on 21 June (the June solstice, day 172). Work through the equation.
- Solar declination on the solstice is at its maximum: \delta = +23.44^\circ.
- Sunrise altitude target: h = -0.833^\circ, so \sin h = -0.01454.
- Plug in: \cos H = \frac{-0.01454 - \sin 40^\circ \sin 23.44^\circ}{\cos 40^\circ \cos 23.44^\circ}.
- Numerator: -0.01454 - (0.6428)(0.3977) = -0.2702. Denominator: (0.7660)(0.9174) = 0.7027.
- So \cos H = -0.3845, which gives H = 112.6^\circ.
- Half-day in hours: 112.6 / 15 = 7.51 hours. Day length is twice that: 15.0 hours.
Solar noon at longitude 105^\circ W falls close to 13:01 local clock time in summer (with the equation of time near -1.6 minutes and daylight time in effect). Sunrise is about 7.51 hours before that, near 05:31, and sunset about 20:32. The tool refines these to the minute; the hand calculation lands within a minute or two.
Reading and interpreting the results
- Solar noon
- The sun's daily peak, exactly midway between sunrise and sunset. If sunrise is 05:31 and sunset is 20:32, solar noon is 13:01.
- Day length
- Sunset minus sunrise. It changes fastest near the equinoxes. At 40 degrees north, days near the March equinox lengthen by roughly 2.5 minutes per day, while near the solstice the change is under 10 seconds per day.
- Civil twilight
- The window when the sun is between the horizon and 6 degrees below it. At 40 degrees north near the equinox it lasts about 24 minutes; near the poles it can last hours.
- Polar day and polar night
- Above 66.5 degrees, the equation has no sunrise or sunset solution on some dates. The sun stays up (polar day) or never rises (polar night).
Day length is symmetric around the solstices but the clock times of sunrise and sunset are not. The earliest sunset comes about two weeks before the December solstice, and the latest sunrise about two weeks after it. The equation of time causes this asymmetry.
Common mistakes
The first mistake is treating the printed times as your local clock time for a distant place. The tool shows times in your browser's time zone. If you compute sunset for Tokyo while sitting in Chicago, the answer appears in Chicago time. Convert it with a time zone converter before you trust it.
The second is expecting minute-perfect accuracy near the poles. Above about 65 degrees, refraction becomes unstable because the sun crosses the horizon at a shallow angle. A one-minute algorithm can be off by several minutes there. Treat high-latitude times as approximate.
Sign conventions bite people. Longitude east is positive and west is negative in this algorithm. Entering 105 for a place at 105 degrees west, instead of -105, shifts solar noon by 14 hours and produces nonsense times.
The third is forgetting elevation and terrain. The computed sunrise assumes a flat sea-level horizon. From a mountaintop the sun appears earlier; from a valley floor, later. The tool cannot see your surroundings.
Related tools
To move a computed sunrise into another city's local time, use the time zone converter. To measure the exact number of hours and minutes between two events such as sunrise and sunset on different dates, use the duration calculator.
Frequently asked questions
Why is sunrise before the sun's center reaches the horizon?
Two effects. The sun has an angular radius of about 0.267 degrees, so its upper edge appears while the center is still below the horizon. Atmospheric refraction lifts the whole image by about 0.567 degrees more. Together they set the sunrise altitude at 0.833 degrees below the true horizon.
Why does the earliest sunset not fall on the shortest day?
The equation of time. In early December the sun runs ahead of the clock, so both sunrise and sunset drift earlier. Combined with the shortening day, the earliest sunset lands about two weeks before the December solstice, while the shortest day itself is at the solstice.
What is civil twilight for?
It marks when there is still enough natural light for outdoor activity without artificial lighting. Civil dawn is when the sun reaches 6 degrees below the horizon in the morning; civil dusk is the evening crossing. Streetlights and car headlights are typically switched around these times.
How accurate are the times?
About one minute for latitudes below roughly 65 degrees on ordinary days. Accuracy degrades near the polar circles because the sun crosses the horizon at a shallow angle, and local air temperature and pressure change refraction in ways the standard model averages out.
What happens above the Arctic and Antarctic circles?
On some dates the sun never sets (polar day) or never rises (polar night). Mathematically the hour-angle equation has no solution because the argument of the arccosine falls outside minus 1 to plus 1. The tool detects this and reports polar day or polar night explicitly.