Skip to content
AZ Tools

Sunrise & Sunset Calculator

Compute sunrise, sunset, solar noon, and all three twilight phases for any latitude, longitude, and date — using the NOAA solar algorithm.

Presets
  • Astronomical dawn05:15:08
  • Nautical dawn05:45:25
  • Civil dawn06:15:50
  • Sunrise06:42:15
  • Solar noon12:17:12
  • Sunset17:52:08
  • Civil dusk18:18:34
  • Nautical dusk18:48:58
  • Astronomical dusk19:19:15
  • Day length11h 09m 53s

NOAA simplified algorithm. Twilight phases: civil 6°, nautical 12°, astronomical 18° below horizon.

How to use

  1. Pick a preset or punch in your own latitude / longitude (negative = south / west).
  2. Set the date.
  3. Adjust the time zone — the algorithm computes in UTC and the display reformats.

About this tool

Show

Implements the simplified NOAA solar position equations: from a date and a (lat, lng) pair, it derives the solar declination and hour angles for each event. Civil twilight = sun 6° below the horizon (when artificial light starts being needed), nautical = 12° (horizon still visible at sea), astronomical = 18° (the sky is fully dark). When the sun never crosses the relevant altitude — polar day or night — the row is left blank and a note appears.

Sunrise is defined as the moment the sun's upper edge touches the horizon, not its centre, and the standard calculation folds in about 34 arcminutes of atmospheric refraction on top of that. Both corrections push the event earlier than pure geometry predicts, by several minutes at temperate latitudes. The refraction figure is an average for standard conditions, so unusual temperature layering near the horizon shifts the real time by a minute or two, and that is the floor on how accurate any such prediction can be.

The blank rows near the poles are a real answer rather than a failure. Above the Arctic and Antarctic circles the sun can stay up or stay down for days, and the twilight thresholds fall out one at a time as you move poleward: a place can have no astronomical night for months while still getting a proper sunset. Saint Petersburg's white nights are exactly that.

The model treats the observer as being at sea level on a smooth horizon. Altitude brings sunrise forward and pushes sunset back, a mountain or a building to the east delays it, and neither is something a latitude and longitude can express. Times are also solar rather than legal: a country whose clocks sit far from their natural meridian, or one on a single time zone spanning a wide span of longitude, will see the calculated time differ from the official tables by more than the rounding.

Day length is derived from the same two events, so it inherits every caveat above.

Frequently asked questions

How accurate is this?

Within ~1 minute for mid latitudes — fine for everyday photography, gardening, or schedule planning. Refraction is approximated to the standard −0.833° offset used by NOAA. For high-precision astronomy use a dedicated ephemeris library.

Why blank values near the poles?

In polar summer the sun never sets (no sunset row) and in polar winter it never rises (no sunrise row). Twilight rows are blank when the sun doesn't dip far enough below the horizon for that phase either.

Why is the time a minute or two off from my weather app?

Because apps differ on the definition rather than on the astronomy. Sunrise is normally the moment the upper edge of the sun crosses the horizon with a standard allowance for atmospheric refraction; a different refraction figure, or a correction for your elevation, shifts the answer by a minute or more. Nothing here knows about the hills or buildings on your actual horizon, which move it much further.

What are the three twilights good for?

Civil twilight is the period when outdoor activity still works without artificial light, and it is what most regulations mean by daylight. Nautical twilight is when the horizon is still visible at sea, which is what a sextant sight needs. Astronomical twilight ends when the sky is dark enough for faint objects. At high latitudes in summer the later phases never arrive, and those rows come back empty.

Related tools