What this calculator does
It works out when the sun rises and sets on any date from the year 1000 to 3000, anywhere on Earth. It also gives solar noon (when the sun is highest), the length of the day, and the start and end of civil, nautical and astronomical twilight. Photographers use it for golden hour, sailors and pilots for twilight, and anyone can use it to plan a hike or check how fast the days are getting shorter.
How it's calculated
The calculator uses the same equations as NOAA's Solar Calculator, which are based on Jean Meeus's Astronomical Algorithms. First it finds the sun's declination δ (how far north or south of the equator it is) and the equation of time (how far a sundial runs ahead of or behind a clock). Then it finds the hour angle H at which the sun's center is at the right depth below the horizon:
Sunrise (minutes after 0:00 UTC) = 720 − 4 × (λ + H) − equation of time
Sunset = 720 − 4 × (λ − H) − equation of time
Solar noon = 720 − 4 × λ − equation of time
Here φ is the latitude and λ the longitude (east positive). For sunrise and sunset, z = 90.833°. That is the U.S. Naval Observatory's definition: the sun's center is 50 arcminutes below the horizon, which is its average radius (16′) plus average refraction at the horizon (34′). For civil, nautical and astronomical twilight, z is 96°, 102° and 108° (the sun's center 6°, 12° and 18° below the horizon). Like NOAA's calculator, it runs twice, the second time using the sun's position at the first answer.
Worked example: New York, June 21, 2026
At latitude 40.7128° N, longitude 74.006° W, the sun's declination is 23.44° and the equation of time is −1.80 minutes.
Sunrise = 720 − 4 × (−74.006 + 113.20) + 1.80 = 565.0 minutes = 9:25 UTC = 5:25 AM EDT
Sunset comes out at 8:31 PM EDT, for a day length of 15 hours 6 minutes. These match NOAA's own table for New York.
Checked against NOAA and the Naval Observatory
| Place and date | Sunrise | Sunset | Reference |
|---|---|---|---|
| New York, June 21, 2026 | 5:25 AM | 8:31 PM | NOAA table; USNO |
| New York, December 21, 2026 | 7:17 AM | 4:32 PM | NOAA table |
| Los Angeles, December 21, 2026 | 6:55 AM | 4:48 PM | NOAA table |
| Los Angeles, October 27, 2026 | 7:08 AM | 6:05 PM | NOAA table |
| Utqiagvik, Alaska, June 21, 2026 | None | None | USNO: sun continuously above the horizon |
Polar day and polar night
Near the poles, cos H can come out above 1 or below −1, which means the sun never reaches that depth. If it never gets 0.833° below the horizon, the sun doesn't set (polar day, or the midnight sun). If it never gets that high, it doesn't rise (polar night). Twilight works the same way: on a winter day in Tromsø the sun doesn't rise, but there are still a few hours of civil twilight around noon. In summer far north, the sky may never get darker than nautical twilight all night.
Limitations
- Accuracy. NOAA describes these equations as accurate to within about a minute between 72° north and south, and to within about 10 minutes nearer the poles. They are "very good" between 1800 and 2100.
- Weather and terrain. Refraction changes with temperature and air pressure. Mountains, buildings or a sea horizon below you also move the moment you see the sun. Results are for a flat, sea-level horizon.
- Time zones. A zone name like America/Denver applies daylight saving time for that date. A plain offset like −7 never changes.