Sunrise & Sunset Calculator
Find local sunrise, sunset, solar noon and day length for any date and place on Earth using the NOAA solar position equations.
°
°
h
Hours between sunrise and sunset.
How does this calculator work?
Enter a date, latitude, longitude and UTC offset to get local sunrise, sunset, solar noon and day length. The tool applies the NOAA solar equations: it derives the equation of time and declination from the day-of-year, solves the sunrise hour angle, and converts to local clock times accurate to about a minute.
Formula
How this is calculated
You provide a calendar date, the latitude φ and longitude L of the location (north and east positive), and the time-zone offset from UTC. The date is converted to a day-of-year N, which sets the fractional year γ = 2π/365·(N−1). From γ the NOAA Fourier series give the equation of time (the offset between clock noon and true solar noon, in minutes) and the solar declination δ (the latitude where the sun is directly overhead).
The sunrise/sunset hour angle comes from ha = acos( cos(90.833°)/(cosφ·cosδ) − tanφ·tanδ ). The 90.833° zenith (slightly past 90°) bakes in atmospheric refraction and the sun’s apparent radius, so the result matches the moment the disc’s upper edge touches the horizon. Times are then sunrise = 720 − 4(L + ha) − eqTime + offset·60 and sunset = 720 − 4(L − ha) − eqTime + offset·60, expressed as minutes after local midnight; solar noon is 720 − 4·L − eqTime + offset·60, and day length equals 8·ha minutes.
Results are accurate to about a minute for typical latitudes. Near the poles the acos argument can leave [−1, 1]: above the Arctic/Antarctic circles in summer the sun never sets (polar day, length 24 h) and in winter it never rises (polar night, length 0 h), which the calculator flags instead of returning a time. The elevation curve plots the sun’s angle above the horizon across the 24-hour local day.
Frequently asked questions
The extra 0.833° accounts for atmospheric refraction (~0.567°) lifting the sun’s image plus the apparent radius of the solar disc (~0.267°). Using the official zenith makes the computed times match when the upper edge of the sun crosses the horizon.
Latitude is positive in the northern hemisphere and negative in the southern. Longitude is positive east of Greenwich and negative to the west. For example, New York City is about 40.71° latitude and −74.01° longitude.
Inside the polar circles the sun may stay up or down all day. When that happens there is no sunrise or sunset moment, so the times read “—” and the day length is reported as 24 h (polar day) or 0 h (polar night).
Also known as
TG we-Calculate Editorial Team. (2026). Sunrise & Sunset Calculator [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/sunrise-sunset-calculator
TG we-Calculate Editorial Team. "Sunrise & Sunset Calculator." TG we-Calculate. 2026. https://we-calculate.com/calculator/sunrise-sunset-calculator.
TG we-Calculate Editorial Team, "Sunrise & Sunset Calculator," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/sunrise-sunset-calculator
@misc{wecalculate_sunrise_sunset_calculator, title = {Sunrise & Sunset Calculator}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/sunrise-sunset-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
