Sunrise Sunset Calculator
Test cases replayed : 4 of 4 match · Methodology · No outside source listed
Enter a date, your latitude and longitude and your clock's UTC offset to get sunrise, sunset, solar noon and the length of the day.
Result
Sunrise
Day of the year
- Fractional year γ (rad)
- Equation of time (minutes)
- Solar declination (degrees)
- Sunrise hour angle (degrees)
- Sunset
- Solar noon
- Day length
Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.
This browser did not allow copying. The sentence is in the box below, already selected: copy it with your keyboard or the menu.
How to use this calculator
Fill in the fields in this order; each step takes you to its field.
- Date: pick a date.
- Latitude (+ north, − south), in °: enter a number from -90 to 90.
- Longitude (+ east, − west), in °: enter a number from -180 to 180.
- UTC offset of your clock (e.g. −5 EST, −4 EDT), in hours: enter a number from -12 to 14.
- Read the result: Sunrise; the panel also shows Day of the year, Fractional year γ (rad), Equation of time (minutes), Solar declination (degrees), Sunrise hour angle (degrees), Sunset, Solar noon and Day length.
How this calculator works
The method is NOAA's General Solar Position Calculations (NOAA Global Monitoring Laboratory, gml.noaa.gov/grad/solcalc/solareqns.PDF, read on 2026-10-27). The fractional year γ = 2π/365 × (day of year − 1) (366 in leap years) gives the equation of time, eqtime = 229.18 × (0.000075 + 0.001868 cos γ − 0.032077 sin γ − 0.014615 cos 2γ − 0.040849 sin 2γ) minutes, and the declination, decl = 0.006918 − 0.399912 cos γ + 0.070257 sin γ − 0.006758 cos 2γ + 0.000907 sin 2γ − 0.002697 cos 3γ + 0.00148 sin 3γ radians.
At sunrise and sunset the zenith is 90.833° (refraction and the size of the solar disk): ha = arccos(cos 90.833° ÷ (cos lat × cos decl) − tan lat × tan decl). In UTC minutes, sunrise = 720 − 4 × (longitude + ha) − eqtime, sunset = 720 − 4 × (longitude − ha) − eqtime and solar noon = 720 − 4 × longitude − eqtime; the calculator then adds your UTC offset. Day length = 8 × ha minutes.
These are approximate equations, usually within a minute or two at mid-latitudes; terrain and weather are ignored. Near the poles, when the sun stays up or down all day, the times show a dash.
Worked example
| Date | 2026-06-21 |
|---|
| Day of the year | 172 |
|---|---|
| Fractional year γ (rad) | 2.9436 |
| Equation of time (minutes) | -1.3282 |
| Solar declination (degrees) | 23.452 |
| Sunrise hour angle (degrees) | 113.2172 |
| Sunrise | 5:24 AM |
| Sunset | 8:30 PM |
| Solar noon | 12:57 PM |
| Day length | 15 h 06 min |
Frequently asked questions
Do I enter EST or EDT?
Enter the offset your clock uses on that date: for New York, −5 in winter (EST) and −4 in summer (EDT).
When are sunrise and sunset at 40.71° N, 74.01° W on June 21, 2026 (EDT)?
About 5:24 AM and 8:30 PM, a day of about 15 h 06 min.
Why does the result show a dash?
At high latitudes the sun can stay above or below the horizon all day (midnight sun or polar night), so there is no sunrise or sunset.