Sunrise and sunset calculator
Enter a date, latitude, longitude, and your UTC offset to get exact sunrise and sunset times, solar noon, day length, and twilight windows for any location on Earth.
Algorithm
The calculator implements the NOAA solar calculations algorithm, which derives solar position from the Julian century elapsed since the J2000 epoch.
Key steps:
- Julian century T = (JD − 2451545) / 36525
- Geometric mean longitude L₀ = 280.47° + 36000.77°·T (mod 360)
- Mean anomaly M = 357.53° + 35999.05°·T
- Equation of center C from sin(M), sin(2M), sin(3M) terms
- Declination δ = arcsin(sin(ε) · sin(λ))
- Equation of time (minutes) from obliquity and longitude
- Solar noon UTC = 720 − 4·longitude − EoT (minutes)
- Hour angle H = arccos((cos(zenith) − sin(lat)·sin(δ)) / (cos(lat)·cos(δ)))
- Sunrise = solar noon − 4·H; Sunset = solar noon + 4·H
Zenith angles: 90.833° for sunrise/sunset (accounting for refraction), 96° for civil, 108° for astronomical twilight.
Worked example
NYC, June 21, 2026 (summer solstice), UTC−5
- Solar noon UTC ≈ 16:59
- Day length ≈ 15h 6m
- Civil dawn before sunrise; astronomical dawn significantly earlier
Notes
- Longitude = 0 is used as the base meridian; the formula accounts for your actual longitude.
- All UTC times may wrap past midnight; the local display adds your offset.
- Extreme latitudes (above ~65°) may show polar conditions near solstices.
Frequently asked
How accurate are the times?
The calculator uses the NOAA solar position algorithm, which is accurate to within a minute or two for most dates and locations. Atmospheric refraction at the horizon is modeled using the standard -0.833° correction.
What is solar noon?
Solar noon is the moment when the sun reaches its highest point in the sky for the day. It occurs when the sun crosses the observer's meridian, which is usually not at 12:00 local clock time due to longitude position within the time zone and the equation of time.
What is civil twilight?
Civil twilight is the period when the geometric center of the sun is between 0° and 6° below the horizon. There is enough natural light for most outdoor activities without artificial lighting. Civil dawn precedes sunrise; civil dusk follows sunset.
What is astronomical twilight?
Astronomical twilight spans 0° to 18° below the horizon. Once the sun is more than 18° below the horizon, the sky is fully dark and faint stars become visible. The calculator uses a 18° zenith angle for astronomical dawn and dusk.
What does polar day or night mean?
At high latitudes near the solstices, the sun may never dip below (polar day) or rise above (polar night) the horizon for the entire 24-hour period. The calculator detects this and reports it instead of showing sunrise and sunset times.
How do I find my latitude and longitude?
Search for your city on any mapping service and look for the coordinates in the URL or location info. NYC is approximately 40.71° N, -74.01° W.
Related calculators
- Daylight duration calculator
Monthly and annual daylight summaries for any latitude.
- Moon phase calculator
Find the lunar phase and illumination for any date.
- Date difference calculator
Exact days between two dates.
- Time zone converter
Convert times between any two time zones.
- Countdown calculator
Count down days, hours, and minutes to any future event.