What this calculator does
Find out when the Sun rises and sets on any date, anywhere on Earth. Sunrise and sunset move through the year because the Earth's axis is tilted. The Sun's declination is how far north or south of the equator it sits overhead. Over the year, it swings between about 23.4° north and 23.4° south. As it does, the Sun's path across the sky gets longer and shorter. The farther you are from the equator, the bigger that change. Where you sit east or west inside your time zone shifts both times together.
This calculator finds the moment the top edge of the Sun touches the horizon. It uses the solar position equations published with the NOAA solar calculator. First it works out the Sun's declination and the equation of time, a small daily correction to clock time. Next it finds solar noon from your longitude and time zone. Then it finds how far the Earth must turn from noon for the Sun to reach the horizon, called the hour angle. It can also give the start and end of civil, nautical and astronomical twilight. And it tells you when the Sun never rises or never sets.
Where it's used
Why this math matters outside the classroom:
- Photography. Photographers plan golden-hour shoots around a sunset time of 8:48 PM in Kansas City on the June solstice.
- Seasons in science. Earth science classes compare a 14 h 55 min June day with a winter day to see how axial tilt changes daylight.
- Outdoor events. Event planners check when civil twilight ends to know when to switch on lighting for an evening race.
- Stargazing. Amateur astronomers wait for the end of astronomical twilight, when the Sun is 18° below the horizon, before deep-sky viewing.
- Solar panels. Installers use solar noon, when the Sun is highest, to check that panels are not shaded at the brightest time of day.
How to use it
- Pick the date.
- Enter the latitude and longitude in decimal degrees. North and east are positive; south and west are negative.
- Enter your time zone's offset from UTC (world standard time) on that date. Include daylight saving time if it applies.
- Choose sunrise and sunset or one of the twilights. Then read the times, solar noon and the length of daylight.
What the inputs mean
- Latitude
- North is positive, south negative (for example, −33.87 for Sydney).
- Longitude
- Longitude sets solar noon. For every degree farther east, the Sun crosses the meridian (the north–south line overhead) 4 minutes earlier. A map app shows the coordinates of any spot.
- Time zone offset from UTC
- The calculator doesn't look up time zones or daylight saving rules. So enter the offset in effect on the date. US Central time is −6 in winter and −5 in summer.
- Event
- Civil twilight ends when the Sun is 6° below the horizon, roughly when outdoor activities need lights. Nautical twilight runs to 12°, and astronomical twilight to 18°, when the sky is fully dark.
Formula and method
solar noon = 720 − 4 × longitude − equation of time + 60 × UTC offset (minutes after midnight) cos H = cos z ÷ (cos φ × cos δ) − tan φ × tan δ sunrise = solar noon − 4 × H; sunset = solar noon + 4 × H (H in degrees) z = 90.833° for sunrise and sunset; 96°, 102° and 108° for civil, nautical and astronomical twilight day length = sunset − sunrise
φ (the Greek letter phi) is your latitude, and δ (delta) is the Sun's declination. H is the hour angle, how far the Earth turns between solar noon and the event. The Earth turns one degree every 4 minutes. z is the zenith angle, the Sun's angle down from straight overhead at the moment you want. cos, tan and arccos are the trigonometry buttons on a scientific calculator. The equation of time corrects for the Earth's oval-shaped orbit and its tilt. Together, those make solar noon drift by up to about 16 minutes through the year.
The zenith angle of 90.833° allows for two things. One is the Sun's own size. The other is the air bending sunlight over the horizon (refraction). Together, they make the Sun appear a few minutes before it otherwise would. Each time is worked out twice, with the Sun's position updated to that moment. If cos H comes out below −1 or above 1, the Sun never reaches that height that day.
Worked example
Kansas City (39.0997° N, 94.5786° W) on 21 June 2026, during Central Daylight Time (UTC−5).
- At solar noon the Sun's declination is 23.44° and the equation of time is −1.88 min.
- Solar noon = 720 + 378.31 − 300 + 1.88 = 800.2 minutes, which is 1:20 PM.
- cos H = −0.3727, so H = 111.88°, or 447.5 minutes either side of noon.
- Refined with the Sun's position at each event: sunrise 5:53 AM and sunset 8:48 PM.
Result: Sunrise is at 5:53 AM and sunset at 8:48 PM, a day of 14 h 55 min.
Understanding the result
The times are for a flat horizon at sea level. Hills or buildings to the east delay the sunrise you see. A high viewpoint brings it a little earlier.
Solar noon is when the Sun is highest and shadows point due north or south. It's rarely exactly 12:00. That's because of where you sit in your time zone, daylight saving time and the equation of time.
Assumptions and limitations
- Standard bending of light by the air (refraction), about 34 arcminutes at the horizon. An arcminute is 1/60 of a degree.
- The UTC offset you enter applies for the whole date.
- NOAA says its method is accurate to about a minute between latitudes 72° north and south. Nearer the poles, it's within about 10 minutes. This holds for dates from 1800 to 2100.
- Unusual weather changes how much the air bends light. So real sunrise and sunset can differ by a minute or two from any calculation.
- Elevation and local terrain aren't included.
Frequently asked questions
Why isn't the longest day also the day with the earliest sunrise?
The equation of time pushes solar noon later through June. In mid-northern latitudes, the earliest sunrise comes about a week before the June solstice. The latest sunset comes about a week after. The longest day falls on the solstice itself.
Why is the day slightly longer than 12 hours on an equinox?
Sunrise and sunset are timed at the top edge of the Sun, not its center. Also, the air bends light, which lifts the image of the Sun above the horizon. Both effects add a few minutes of daylight at each end.
What happens near the poles?
Above the Arctic and Antarctic circles, there are dates when the Sun never sets or never rises. The calculator then reports midnight sun or polar night instead of times. The twilight options show whether the sky still brightens.
Which twilight should I use?
Civil twilight suits everyday outdoor plans and photography's blue hour. Nautical twilight is when the horizon at sea fades from view. Astronomical twilight marks a fully dark sky for stargazing.
Sources
- NOAA Global Monitoring Laboratory: Solar Calculation Details (checked 2026-10-19)
How this calculator is checked
Method: NOAA Global Monitoring Laboratory solar calculator equations (after Meeus, Astronomical Algorithms): declination, equation of time and hour angle at zenith 90.833° or the twilight angles, iterated at each event; checked against US Naval Observatory times. The calculation is covered by automated tests with known reference values and edge cases. Last updated 2026-10-18. Found a problem? Tell us.
Embed this calculator
Put this Sunrise and Sunset Calculator on your own website or blog for free. Paste this code where you want it to appear: