Sunrise & Sunset Calculator
Free sunrise sunset calculator. Enter latitude, longitude, and date to get exact sunrise, sunset, solar noon, and day length using the NOAA algorithm.
Updated 2026-06-14 · Free · No sign-up · Runs privately in your browser
Show the method
Uses the NOAA solar algorithm with a 90.833° zenith (allowing for refraction and the sun's radius). Times are clock times for the UTC offset you enter; set it to match the date's daylight-saving rules.
How the Sunrise & Sunset Calculator Works
This tool calculates the sunrise, sunset, solar noon, and day length for any place on Earth and any date, using the NOAA solar position algorithm. Enter your latitude, longitude, the date, and your UTC offset, and it returns local clock times accurate to about a minute.
The Formula
For a given date, the algorithm computes the sun’s declination (δ) and the equation of time, then solves for the hour angle (H) at which the sun reaches the horizon:
cos H = (cos(90.833°) − sin(latitude) × sin(δ)) ÷ (cos(latitude) × cos(δ))
The 90.833° zenith is used instead of 90° to allow for atmospheric refraction (~0.57°) and the sun’s apparent radius (~0.27°). From the hour angle:
Sunrise = solar noon − 4 min × H Sunset = solar noon + 4 min × H
where solar noon (in local minutes) = 720 − 4 × longitude − equation of time + UTC-offset × 60. Each degree of hour angle equals 4 minutes of time.
Worked Example
For New York City (40.71° N, 74.01° W) on 20 June 2024, with a UTC offset of −4 (EDT):
- Solar declination ≈ +23.44° (near the summer solstice)
- Equation of time ≈ −1.6 minutes
- Solving the hour-angle equation gives sunrise ≈ 05:25 and sunset ≈ 20:30
- Day length ≈ 15 hours 5 minutes
| Location (summer solstice) | Sunrise | Sunset | Day length |
|---|---|---|---|
| New York (40.7° N) | 05:25 | 20:30 | ~15h 05m |
| London (51.5° N) | 04:43 | 21:22 | ~16h 39m |
| Sydney (33.9° S, winter) | 07:00 | 16:54 | ~9h 54m |
Reading the Results
Day length is simply sunset minus sunrise; it lengthens toward the summer solstice and shortens toward winter, and the effect grows stronger the closer you are to the poles. Solar noon is when the sun is highest — note that it usually differs from 12:00 because of your position within the time zone and the equation of time.
Tips for Accuracy
Set the UTC offset to match the date’s daylight-saving status (for example, −4 for US Eastern in summer, −5 in winter). The calculation assumes a flat, unobstructed sea-level horizon, so mountains, tall buildings, or high elevation will shift the times you actually observe. For polar latitudes during midsummer or midwinter, the tool correctly reports midnight sun or polar night when the sun never sets or never rises.
Frequently asked questions
How does a sunrise sunset calculator work?+
It computes the sun's position for your date and location using the NOAA solar algorithm. From the date it finds the sun's declination and the equation of time, then uses your latitude to solve for the hour angle when the sun is at the horizon (a 90.833° zenith), giving the sunrise and sunset clock times.
Why is the zenith angle 90.833 degrees and not 90?+
Sunrise and sunset are defined as when the top of the sun touches the horizon, not the center. Adding about 0.833° accounts for the sun's apparent radius (roughly 0.27°) plus average atmospheric refraction (about 0.57°), which lifts the sun's image above its true geometric position.
What is solar noon?+
Solar noon is the moment the sun is highest in the sky and crosses the local meridian, halfway between sunrise and sunset. It rarely falls exactly at 12:00 clock time because of your longitude within the time zone, daylight saving, and the equation of time.
Why are there no sunrise and sunset in polar regions?+
Near the poles in summer the sun can stay above the horizon for 24 hours (midnight sun), and in winter it can stay below it all day (polar night). When that happens, the hour-angle equation has no solution, so the calculator reports midnight sun or polar night instead of a time.
How accurate are the calculated times?+
The NOAA-based method is typically accurate to within about a minute for locations between roughly 72° north and south latitude. Real observed times can shift slightly with elevation, local horizon obstructions, unusual atmospheric conditions, and your exact daylight-saving offset.