Sunrise, Sunset, and Twilight Times

Type a latitude and longitude, pick a date, and read off sunrise, sunset, solar noon, day length, and the three twilight times (civil, nautical, astronomical). Built on the NOAA Almanac for Computers formula. Pure math in your browser, no upload, works offline once loaded.

Educational use. The algorithm is the simplified USNO form, accurate to ~1 minute at low and mid latitudes and ~10-15 minutes at high latitudes. For legal timekeeping, surveying, or navigation, use a purpose- built ephemeris (e.g. Jean Meeus, Astronomical Algorithms). Day length is the duration the sun is above the horizon (apparent radius + average atmospheric refraction); twilight times use the standard −6°, −12°, −18° altitude cutoffs.

°N Decimal degrees, north positive (−90..+90).
°E Decimal degrees, east positive (−180..+180).
Preset cities

Solar events

Sunrise

Sunset

Day length

Solar noon

Twilight

Civil = sun 6° below horizon · Nautical = 12° · Astronomical = 18°.

Civil dawn

Light enough to read outside

Civil dusk

Light enough to read outside

Nautical dawn

Horizon visible at sea

Nautical dusk

Horizon visible at sea

Astronomical dawn

Sky fully dark begins

Astronomical dusk

Sky fully dark begins

Daylight timeline

Visual summary from astronomical dawn to astronomical dusk. Astronomical twilight that does not occur on this day (polar day / polar night) is hidden.

About the algorithm

The solar position is computed from the simplified Almanac for Computers formula published by the US Naval Observatory (chapter Rise and Set, 1990 reprint) and re-implemented by the NOAA Global Monitoring Laboratory. It expands the mean longitude, mean anomaly, and obliquity of the ecliptic as low-order polynomials in centuries since the J2000.0 epoch, then derives the apparent right ascension, declination, and Greenwich hour angle of the sun for the date and time of interest. The hour angle for each event is the inverse of the standard horizon altitude equation.

The accuracy is documented as ~1 minute for non-polar latitudes; at high latitudes the simplified expansion accumulates an additional systematic offset of ~10-15 minutes near the solstices. We use this algorithm because it is closed-form, runs in microseconds, and has no external dependencies. For sub-minute accuracy, use a purpose-built ephemeris like the SPA algorithm or Jean Meeus's Astronomical Algorithms.