Sunrise Sunset Time Calculator

Enter a latitude, longitude, date, and UTC offset to estimate local sunrise, sunset, and the length of daylight. The calculator uses the standard solar position algorithm: it computes the Sun's declination and the equation of time, then solves for the hour angle at which the Sun's centre sits 0.833 degrees below the horizon (the refraction-corrected definition of sunrise and sunset). Results are accurate to about a minute for most locations.

--
--
--

The solar position method

Solar declination delta from day of year
Equation of time correction (minutes)
cos(H) = (sin(-0.833 deg) - sin(lat) sin(delta)) / (cos(lat) cos(delta))
Solar noon (local) = 12 - longitude/15 - eqtime/60 + UTC offset
Sunrise = solar noon - H/15, Sunset = solar noon + H/15

H is the sunrise hour angle in degrees, divided by 15 to convert to hours. If cos(H) lies outside the range -1 to 1, the Sun never reaches the horizon on that date.

Definitions used

  • Sunrise and sunset use the standard altitude of -0.833 degrees (refraction plus solar radius).
  • Latitude is positive north of the equator, longitude positive east of Greenwich.
  • UTC offset includes daylight saving if it applies on the date.
  • Daylight length is sunset minus sunrise.

Sunrise and sunset: frequently asked questions

How is sunrise time calculated?

The calculator uses the standard solar position algorithm: it finds the Sun's declination and the equation of time for the date, then solves the hour angle at which the Sun's centre is at the standard sunrise altitude (about 0.833 degrees below the horizon, allowing for refraction). That hour angle is converted to a local clock time using your longitude and UTC offset.

What is the standard sunrise altitude of minus 0.833 degrees?

Official sunrise and sunset are defined as the moment the Sun's upper edge touches the horizon. Atmospheric refraction lifts the apparent Sun by about 34 arc minutes, and the Sun's radius is about 16 arc minutes, so the geometric centre sits about 0.833 degrees below the horizon at that moment.

Why might the result differ from my local almanac by a minute or two?

This algorithm is a well-established approximation accurate to about a minute for most latitudes. Differences arise from local elevation, terrain, exact refraction conditions, and the precise definition used. For navigation or legal purposes, consult the official tables linked below.

What happens at high latitudes near the poles?

Near the poles the Sun may not rise or set at all on a given date (polar day or polar night). When the geometry has no solution, the calculator reports that the Sun does not rise or set on that date at that latitude.

Official sources

  • U.S. Naval Observatory, astronomical applications: aa.usno.navy.mil (official rise and set tables).
  • NOAA Earth System Research Laboratories solar calculator method (general solar position equations).

Reviewed by the CalculatorHub team, edited by James Graham, 19 June 2026. See our methodology.