When will the Sun rise tomorrow at your campsite, how long will the days be in December in Reykjavík, or when does it get dark enough to photograph the Milky Way? This sunrise sunset calculator answers those questions for any date and any place on Earth from three numbers: the latitude, the longitude and the UTC offset of the local clock.
It uses the algorithm of the NOAA Global Monitoring Laboratory solar calculator, itself built on the formulas in Jean Meeus's Astronomical Algorithms. The method computes the Sun's position (its declination and the equation of time) for the date, finds the hour angle at which the Sun's centre sits 0.833° below the horizon, and refines the answer by iteration. NOAA states an accuracy of about one minute between latitudes 72° north and south, which is better than the effect of hills, haze or your altitude.
Besides sunrise and sunset, you get solar noon (when the Sun is highest and shadows point due north or south), the day length, the Sun's elevation at noon, and the start and end of the three twilights: civil (enough light to work outdoors), nautical (horizon still visible at sea) and astronomical (the sky fully dark only after it ends). Near the poles the calculator tells you when the Sun never sets (midnight sun) or never rises (polar night) instead of showing impossible times.
The date defaults to today. The calculation runs entirely in your browser; nothing about your location is sent anywhere.
How to use this calculator
- Pick the date.
- Enter the latitude in decimal degrees, positive north of the equator, negative south.
- Enter the longitude, positive east of Greenwich, negative west. Map apps show both when you long-press a place.
- Enter the UTC offset of the local clock on that date, including daylight saving time (Paris +2 in summer, New York −5 in winter).
- Read sunrise, sunset, solar noon, day length and the six twilight times. A note appears for midnight sun, polar night or a suspicious offset.
The formula
With the number of Julian centuries since J2000.0, NOAA computes the Sun's apparent longitude and the obliquity , then the declination and the equation of time (minutes):
The hour angle at which the Sun's centre reaches the zenith angle at latitude is
with for sunrise and sunset (34′ of refraction plus the 16′ solar radius), for civil, for nautical and for astronomical twilight. Times in minutes after midnight UTC, with longitude in degrees east, are
and the local time adds the UTC offset. If the Sun never climbs that high; if it never sinks that low.
Worked example
Paris (48.8566° N, 2.3522° E) on the June solstice, 21 June 2026, UTC+2. The Sun rises at 05:47 and sets at 21:58, solar noon is at 13:52, and the day lasts 16 hr 11 min. Civil dusk comes at 22:41; the Sun culminates 64.6° above the horizon.
Six months later, 21 December 2026, UTC+1: sunrise 08:41, sunset 16:56, solar noon 12:49, a day of only 8 hr 15 min, with the Sun no higher than 17.7°.
Solar noon is not at 12:00 because Paris lies east of the centre of its time zone, summer time adds an hour, and the equation of time shifts noon by up to about 16 minutes during the year.
Civil, nautical and astronomical twilight
Twilight is the period when the Sun is below the horizon but still lights the sky. It is split by how far the Sun's centre is below the horizon:
| Twilight | Sun below horizon | What you can see |
|---|---|---|
| Civil | 0.833° to 6° | Outdoor work without lights, brightest stars and planets |
| Nautical | 6° to 12° | Sea horizon still visible for star sights |
| Astronomical | 12° to 18° | Sky almost dark; faint objects still washed out |
Dawn is the start of a twilight in the morning, dusk its end in the evening. In summer at high latitudes the Sun may never sink 18° (or even 6°) below the horizon, so the twilight lasts all night: the "white nights" of Saint Petersburg.
Why day length depends on latitude and season
The Earth's axis is tilted about 23.44° to its orbit, so the solar declination swings between +23.44° in June and −23.44° in December. At the equator day and night stay close to 12 hours all year (slightly more for the day, because of refraction and the size of the Sun's disc). Towards the poles, the difference grows until, beyond the polar circles, the Sun stays up or down for whole days. Use the latitude and longitude distance calculator to compare places, or the solar panel calculator to turn daylight into energy.
Frequently asked questions
How accurate are the sunrise and sunset times?
NOAA gives about one minute between 72° N and 72° S, up to about 10 minutes nearer the poles. Real observations can differ by a few minutes because of terrain, your height above sea level and unusual atmospheric refraction.
What exactly counts as sunrise?
The moment the upper edge of the Sun appears on a flat horizon. The calculator models it as the Sun’s centre reaching 0.833° below the geometric horizon: 0.567° (34′) for refraction plus about 0.267° (16′) for the Sun’s radius.
Why is solar noon not at 12:00?
Clock time follows a time zone, not your longitude: each degree east or west of the zone’s central meridian shifts noon by 4 minutes. Daylight saving time adds an hour, and the equation of time, caused by the Earth’s elliptical orbit and axial tilt, moves noon by −14 to +16 minutes over the year.
What UTC offset should I enter?
The offset of the local clock on the chosen date, including daylight saving time: for example +1 for Paris in winter and +2 in summer, 0 for London in winter and +1 in summer. Using the wrong offset shifts every time by whole hours.
Why does it say the Sun does not rise or set?
Beyond about 66.5° of latitude the Sun can stay above the horizon for 24 hours around the June solstice (midnight sun) or below it around the December solstice (polar night) in the north, and the other way round in the south.
Sources
- NOAA Global Monitoring Laboratory — Solar Calculation Details
- NOAA GML — General Solar Position Calculations (PDF)
- Jean Meeus — Astronomical Algorithms, 2nd ed. (Willmann-Bell, 1998), ch. 25 and 28
Last updated: