Sunrise and Sunset Calculator
Get sunrise, sunset, solar noon, and day length for any date and location.
What it does
Sunrise and sunset look simple until the date and location move. The sun's declination swings 47 degrees across the year, and each latitude converts that swing into a different day length.
The NOAA solar equations, built on Meeus's astronomical formulas, compute the sun's position at your coordinates and date. They bend the answer for atmospheric refraction, about 0.833 degrees, which is why the sun appears to rise before it geometrically does.
The tool above takes latitude, longitude, a UTC offset, and a date, then returns sunrise, sunset, solar noon, and total daylight. The defaults, New York City on June 21, 2026, give the longest day there: 5:24 AM to 8:30 PM, 15 hours and 6 minutes of light.
Longitude sets the clock alignment, latitude sets the season's swing, and the offset you enter decides whether the printed times land on your watch. Get the offset wrong by a full hour and every time shifts by 60 minutes, which is the single most common confusion with pages like this.
Results land within roughly a minute of almanac tables on flat ground. Hills, mountains, and buildings move the real horizon, and the equations assume sea level, so treat the output as the astronomical answer, not a view from your backyard.
How to use
- Enter latitude, positive north of the equator.
- Enter longitude, positive east of Greenwich.
- Enter the UTC offset for the date, including daylight saving.
- Pick any date you care about.
- Read sunrise, sunset, solar noon, and day length.
- For polar dates, read the plain message shown instead.
Formula
- HA
- Hour angle in degrees: how far from solar noon the sun sits at the horizon.
- dec
- Solar declination, the sun's latitude, from the NOAA series.
- eqtime
- Equation of time in minutes, the offset between solar and mean time.
- longitude
- East positive in degrees; times are then UTC until the offset is applied.
The 90.833 degree zenith allows for refraction and the sun's half disk, matching standard sunrise and sunset definitions. Everything runs in UTC minutes since the day started, and the UTC offset converts to the local clock. Inside the polar circles the cosine argument leaves the valid range on some dates, where the sun simply stays up or down all day and the tool says so in words.
Worked example
Example: New York, June 21, 2026
Latitude 40.7128, longitude -74.006, UTC offset -4, date 2026-06-21 (defaults).
- Day of year 172: gamma = 2 x pi / 365 x 171 = 2.943 rad.
- Equation of time: -1.33 minutes; declination: +23.45°.
- Hour angle: acos(-0.394) = 113.2°.
- Sunrise: 720 - 4 x (-74.006 + 113.2) + 1.33 = 564.5 UTC min; minus 240 = 324.5, or 5:24 AM.
- Sunset: 720 - 4 x (-74.006 - 113.2) + 1.33 = 1,470.2 UTC min; minus 240 = 1,230.2, or 8:30 PM.
- Daylight: 905.8 minutes = 15 h 06 min; solar noon lands at 12:57 PM.
Reference table
| Location and date | Sunrise | Sunset | Daylight |
|---|---|---|---|
| New York, Jun 21 (offset -4) | 5:24 AM | 8:30 PM | 15 h 06 min |
| New York, Dec 21 (offset -5) | 7:16 AM | 4:31 PM | 9 h 15 min |
| London, Jun 21 (offset +1) | 4:43 AM | 9:21 PM | 16 h 39 min |
| Sydney, Dec 21 (offset +11) | 5:41 AM | 8:05 PM | 14 h 24 min |
| Anchorage, Jun 21 (offset -8) | 4:20 AM | 11:42 PM | 19 h 23 min |
Limits
- Flat sea level horizon; mountains and buildings shift real times.
- Fixed 0.833 degree refraction; unusual atmospheric conditions differ.
- One UTC offset per date, so dates spanning a daylight saving change need care.
- No twilight outputs here; civil, nautical, and astronomical dusk are separate.
Common mistakes
- Forgetting to move the UTC offset when daylight saving changes.
- Entering a western longitude without the minus sign.
- Using the date of a different year and expecting identical clock times.
- Reading solar noon as 12:00 exactly; it drifts up to a quarter hour with the equation of time.
- Expecting rooftop visibility to match the flat horizon the math assumes.
Try it yourself
Quick checks. Answers sit tucked under each question.
New York, June 21, 2026, offset -5?
Sunrise 4:24 AM, sunset 7:30 PM, solar noon 11:57 AM, 15 h 06 min.
London 51.5074, -0.1278, offset +1, June 21?
Sunrise 4:43 AM, sunset 9:21 PM, solar noon 1:02 PM, 16 h 39 min.
Anchorage 61.2181, -149.9003, offset -8, June 21?
Sunrise 4:20 AM, sunset 11:42 PM, solar noon 2:01 PM, 19 h 23 min.
Questions
How accurate is this?
Within about a minute of published tables on a flat horizon. Terrain, buildings, and unusual air conditions can move real sunrise by several minutes.
Why enter a UTC offset?
The equations work in UTC. The offset is the only link between the math and your wall clock, and it must match the date, daylight saving included.
What is solar noon?
The moment the sun crosses your meridian, its highest point of the day. It rarely lands at 12:00 because of the equation of time and your position inside the time zone.
What happens above the Arctic Circle?
Some dates have no sunrise or sunset at all. The tool detects this and reports midnight sun or polar night instead of inventing times.
Do mountains matter?
Yes, significantly. A high eastern ridge can hold back sunrise by half an hour or more; this tool assumes an open, flat horizon.
Why do the solstices differ between years?
Leap years shift the calendar relative to the sun by about a quarter day, moving clock times by a minute or so between years, and the longer term drift is even slower.
Sources
- NOAA Global Monitoring Laboratory: solar calculation details
- NOAA solar equations PDF: the exact formulas used here