Daylight Hours Calculator
Day length depends on two things: the date, which sets the Sun's declination, and your latitude, which sets how that declination translates into time above the horizon. This calculator combines them using the standard sunrise equation: it estimates the Sun's declination for your chosen date, finds the hour angle at sunrise and sunset, and converts that into the number of daylight hours. Near the equator the result stays close to 12 hours all year, while toward the poles it swings to extremes, reaching the midnight sun or polar night inside the polar circles. It is a geometric estimate ignoring refraction.
Daylight hours formula
N = day of year
declination = -23.44 deg * cos(360/365 * (N + 10))
cosH = -tan(latitude) * tan(declination)
if cosH <= -1: 24 hours; if cosH >= 1: 0 hours
daylight hours = 2 * acos(cosH) in degrees / 15
The hour angle H marks where the Sun is on the horizon. Doubling it covers sunrise to sunset, and dividing degrees by 15 converts to hours because the sky turns 15 degrees per hour. Refraction and the Sun's disc are ignored.
Daylight notes
- Near the equator daylight stays close to 12 hours all year.
- The June solstice gives the longest day in the Northern Hemisphere.
- Inside the Arctic or Antarctic circles you can get 24 or 0 hours of daylight.
- Use a negative latitude for the Southern Hemisphere.
- This geometric estimate can differ from published tables by several minutes.
Daylight hours: frequently asked questions
How is day length calculated?
The calculator finds the Sun's declination for your date, then uses the sunrise equation to find the hour angle at which the Sun crosses the horizon. The hour angle, doubled and converted from degrees to hours, gives the time the Sun is above the horizon, which is the daylight length.
What is solar declination?
Solar declination is the angle between the Sun's rays and Earth's equatorial plane. It ranges from about plus 23.44 degrees at the June solstice to minus 23.44 degrees at the December solstice, and it is the main reason day length changes through the year and differs by latitude.
Why does latitude matter so much?
Near the equator day length stays close to 12 hours all year. The further you go toward the poles, the more extreme the seasonal swing, until inside the polar circles you get continuous daylight in summer and continuous night in winter, when the Sun does not rise or set at all.
How accurate is this estimate?
It uses a standard approximation for declination and the geometric sunrise equation, ignoring atmospheric refraction and the Sun's disc size, so it can differ from published sunrise and sunset tables by several minutes. For precise times, use the NOAA solar calculator or U.S. Naval Observatory data.
What does a result of 24 or 0 hours mean?
At high latitudes near the solstices the Sun may never set, giving 24 hours of daylight, or never rise, giving 0 hours. The calculator caps the result at these limits when the geometry has no sunrise or sunset, which is the midnight sun or polar night.
Official sources
- NOAA Global Monitoring Laboratory: Solar Calculator.
- U.S. Naval Observatory: Astronomical Applications.
Reviewed by the CalculatorHub team, edited by James Graham, 17 June 2026. See our methodology.