How Sunrise and Sunset Are Calculated

The principles of the astronomical calculation that finds sunrise and sunset times from just latitude, longitude, and date.

Starting from the sun's position

Sunrise and sunset times are found by calculating where the sun is in the sky on a given date. From Earth's orbit and the tilt of its rotation axis, we first find the sun's right ascension and declination.

Hour angle and solar noon

Using the observer's latitude and the sun's declination, we calculate the 'hour angle' at which the sun reaches a specific altitude (about −0.833° for sunrise). Relative to solar noon, when the sun is due south, an offset of that hour angle before it is sunrise and after it is sunset.

  • −0.833°: the sunrise/sunset reference altitude that accounts for atmospheric refraction and the sun's radius
  • −6, −12, −18°: the civil, nautical, and astronomical twilight criteria

Accuracy

Outside the polar regions this method is accurate to within ±1 minute. This calculator implements the NOAA/Meeus algorithms directly and computes in the browser.

At very high latitudes, on certain dates the sun may not rise at all (polar night) or may not set (midnight sun).
PreviousA Guide to Magic-Hour Photography
← Back to guides