Sunrise & Sunset Calculator

Find exact sunrise, solar noon, and sunset times for any location and date.

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

A sunrise and sunset calculator that works entirely in your browser using a published astronomical algorithm. Enter any latitude, longitude, and date and the tool returns the exact UTC times for sunrise, solar noon, and sunset, together with the total daylight duration, the sun’s declination, and the equation of time — all with no network request and no API key required.

How it works

The calculation follows the NOAA Solar Calculator method, a practical distillation of Jean Meeus’s Astronomical Algorithms. The steps are:

  1. Julian Day Number — the date is converted to a continuous count of days since noon UTC on 1 January 4713 BC using the Fliegel–Van Flandern integer formula.

  2. Julian centuries since J2000.0 — expressed as n / 36525 where n is the day offset from 1.5 January 2000.

  3. Solar position — the sun’s mean longitude, mean anomaly, equation of centre, true longitude, apparent longitude, obliquity of the ecliptic, and finally right ascension and declination (delta) are derived from polynomial fits to the orbital elements.

  4. Equation of time — a trigonometric expression that quantifies the difference between apparent solar time (sundial) and mean solar time (clock), in minutes.

  5. Solar noonnoon_UTC = (720 - 4 * longitude - eqT) / 60 hours, where longitude is in degrees and eqT is the equation of time in minutes.

  6. Hour angle — the key formula is:

    cos(H) = (cos(zenith) - sin(lat) * sin(dec)) / (cos(lat) * cos(dec))

    For standard sunrise/sunset the zenith is 90.833 degrees, which already accounts for atmospheric refraction (about 0.5 deg) and the semi-diameter of the solar disc (about 0.25 deg). Sunrise occurs at noon - H/15 hours UTC; sunset at noon + H/15.

  7. Polar conditions — when cos(H) falls outside the range (-1, 1) the sun never crosses the horizon and no time exists; the calculator reports this state explicitly.

Worked example: London, midsummer

For 21 June 2026 at latitude 51.5074 N, longitude -0.1278 E (London):

  • Sunrise: approximately 03:43 UTC (04:43 BST, UTC+1)
  • Solar noon: approximately 12:01 UTC
  • Sunset: approximately 20:21 UTC (21:21 BST)
  • Daylight duration: roughly 16 h 38 m
  • Solar declination: +23.4 deg (sun at its northernmost point, summer solstice)

Compare with 21 December 2026 (winter solstice):

  • Sunrise: approximately 08:03 UTC
  • Sunset: approximately 15:57 UTC
  • Daylight duration: only about 7 h 54 m

The dramatic swing from nearly 17 hours to under 8 hours of daylight across the year illustrates why latitude has such a large effect on seasons at temperate and polar locations.

Formula note

The zenith value of 90.833 deg is a standard convention that bakes in:

  • 0.5833 deg for atmospheric refraction at the horizon (air bends sunlight slightly upward, so you see the sun rise a little before it geometrically clears the horizon)
  • The remaining 0.25 deg accounts for the solar disc radius

If you wanted astronomical sunrise (geometric centre of the sun on the mathematical horizon, no refraction), you would use a zenith of exactly 90 deg instead.

The equation of time means that the earliest sunrise and latest sunset do not fall exactly on the solstice — the earliest UK sunset occurs around 12 December, a week or two before the December solstice, precisely because of this effect.

Ad placeholder (rectangle)