Sunrise & Sunset Calculator
Sunrise (approx)
—
Sunset (approx)
—
Day Length
—
Solar Noon
—
How Sunrise and Sunset Are Calculated
Sunrise and sunset times are determined by the geometric relationship between Earth's axial tilt, its orbital position around the Sun, and the observer's latitude. According to the U.S. Naval Observatory, which maintains the authoritative Astronomical Almanac, the Sun's apparent position in the sky follows a predictable path governed by solar declination and the observer's geographic coordinates. The declination of the Sun varies between +23.45 degrees (summer solstice in the Northern Hemisphere) and -23.45 degrees (winter solstice) over the course of a year, driven by Earth's 23.44-degree axial tilt relative to its orbital plane.
This calculator uses the hour angle method to estimate sunrise and sunset times. The solar declination is first computed from the day of year, then the hour angle is derived from the relationship between latitude and declination. The hour angle represents how far the Sun must travel from its noon position to reach the horizon. At the equator, day length stays near 12 hours year-round, while at 60 degrees latitude, it ranges from roughly 6 hours in winter to 18.5 hours in summer. These variations directly affect agriculture, energy consumption, and human circadian rhythms worldwide. For related astronomical calculations, see our telescope magnification calculator.
The Sunrise and Sunset Formula
The core formula calculates the hour angle (HA) at which the Sun crosses the horizon:
cos(HA) = -tan(latitude) x tan(declination)
Where declination is approximated as: decl = 23.45 x sin(360/365 x (284 + day_of_year)). Sunrise occurs at solar noon minus HA/15 hours, and sunset at solar noon plus HA/15 hours. For example, at latitude 40 degrees N on June 21 (day 172), the declination is approximately +23.45 degrees, giving an hour angle of about 112.6 degrees. This translates to sunrise at roughly 5:30 and sunset at 20:30 solar time, yielding about 15 hours of daylight. When cos(HA) falls below -1, the Sun never sets (midnight sun); when it exceeds +1, the Sun never rises (polar night).
Key Terms
- Solar Declination: The angle between the Sun's rays and Earth's equatorial plane, ranging from -23.45 to +23.45 degrees over the year.
- Hour Angle: The angular distance the Sun must travel from noon to reach the horizon, measured in degrees (15 degrees per hour).
- Solar Noon: The moment when the Sun crosses the local meridian and reaches its highest point in the sky for that day.
- Twilight: The period before sunrise and after sunset when the sky is partially illuminated. Civil twilight ends when the Sun is 6 degrees below the horizon.
- Day Length: The duration between sunrise and sunset, determined by latitude and solar declination.
- Atmospheric Refraction: Bending of sunlight by Earth's atmosphere, which makes the Sun appear about 0.57 degrees higher than its geometric position, effectively adding roughly 2-4 minutes to each day.
Day Length by Latitude and Season
The following table shows approximate day lengths at various latitudes on key dates. Data is based on U.S. Naval Observatory calculations and represents the period from sunrise to sunset, excluding twilight.
| Latitude | Mar 20 (Equinox) | Jun 21 (Solstice) | Sep 22 (Equinox) | Dec 21 (Solstice) |
|---|---|---|---|---|
| 0 (Equator) | 12h 7m | 12h 7m | 12h 7m | 12h 7m |
| 20 N | 12h 9m | 13h 12m | 12h 9m | 11h 0m |
| 40 N | 12h 11m | 14h 52m | 12h 11m | 9h 20m |
| 50 N | 12h 13m | 16h 21m | 12h 13m | 7h 50m |
| 60 N | 12h 16m | 18h 30m | 12h 16m | 5h 53m |
| 66.5 N (Arctic) | 12h 19m | 24h 0m | 12h 19m | 0h 0m |
Practical Examples
Example 1 -- New York City (40.7 N), June 21: With a solar declination of +23.45 degrees, the hour angle calculates to approximately 112.6 degrees. Sunrise occurs around 5:25 AM and sunset around 8:30 PM (solar time), giving about 15 hours and 5 minutes of daylight. This is the longest day of the year at this latitude.
Example 2 -- Sydney, Australia (33.9 S), December 21: The Southern Hemisphere experiences summer solstice in December. With the Sun at +23.45 degrees declination (summer for the south), Sydney gets approximately 14 hours and 23 minutes of daylight. Use our time zone converter to translate solar time to local clock time.
Example 3 -- Tromso, Norway (69.6 N), June 21: At this latitude above the Arctic Circle, cos(HA) = -tan(69.6) x tan(23.45) drops below -1, meaning the Sun never sets. Tromso experiences continuous daylight (midnight sun) from approximately May 20 to July 22 each year.
Tips for Using Sunrise and Sunset Data
- Photography golden hour: The best light for outdoor photography occurs roughly 30-60 minutes after sunrise and before sunset. Plan shoots around these times for warm, diffused lighting.
- Adjust for longitude within timezone: Solar time differs from clock time based on your position within a time zone. Cities on the western edge of a zone see sunset 30-60 minutes later than cities on the eastern edge.
- Account for elevation: Higher elevations see sunrise earlier and sunset later. At 1,000 meters elevation, sunrise occurs approximately 3 minutes earlier than at sea level.
- Daylight Saving Time: Remember to add 1 hour to solar-calculated times during DST periods. This calculator shows solar time, not local clock time.
- Plan outdoor activities: Use day length data to estimate available working or recreation hours, especially important for construction, agriculture, and hiking at high latitudes.
Frequently Asked Questions
Why do day lengths change throughout the year?
Earth's axis is tilted 23.44 degrees relative to its orbital plane around the Sun. As Earth orbits, this tilt causes different hemispheres to receive more or less direct sunlight. During summer in the Northern Hemisphere, the North Pole tilts toward the Sun, increasing the angular path the Sun travels above the horizon each day. According to the National Oceanic and Atmospheric Administration (NOAA), this tilt is the sole cause of seasonal day length variation. At the equator, day length remains nearly constant at about 12 hours year-round, while at 60 degrees latitude it ranges from about 6 to 18.5 hours.
When is the longest day of the year?
The longest day occurs on the summer solstice, which falls on June 20 or 21 in the Northern Hemisphere and December 21 or 22 in the Southern Hemisphere. At 40 degrees North latitude (New York, Madrid, Beijing), the summer solstice delivers approximately 15 hours of daylight. At 50 degrees North (London, Paris), it reaches about 16 hours and 20 minutes. At the Arctic Circle (66.5 degrees N), the Sun does not set at all on the solstice, resulting in 24 hours of continuous daylight.
What causes the midnight sun phenomenon?
The midnight sun occurs at latitudes above 66.5 degrees (the Arctic and Antarctic Circles) when Earth's axial tilt causes the Sun to remain above the horizon for a full 24-hour rotation. In Tromso, Norway (69.6 degrees N), continuous daylight lasts from approximately May 20 to July 22. At the North Pole itself, the Sun remains above the horizon for about 6 continuous months, from the March equinox to the September equinox. The inverse phenomenon, polar night, occurs during winter when the Sun stays below the horizon for extended periods.
How accurate is this sunrise/sunset calculator?
This calculator is accurate to within approximately 5-10 minutes of actual sunrise and sunset times. It uses the standard solar declination and hour angle equations but does not account for atmospheric refraction (which adds about 2-4 minutes of daylight per day), Earth's orbital eccentricity (which shifts the equation of time by up to 16 minutes), or observer elevation above sea level. For precision timing, the U.S. Naval Observatory and NOAA provide tables that include these corrections.
How does atmospheric refraction affect sunrise and sunset?
Atmospheric refraction bends sunlight as it passes through Earth's atmosphere, causing the Sun to appear approximately 0.57 degrees higher than its true geometric position when it is near the horizon. This means you can see the Sun before it has geometrically risen and after it has geometrically set. The net effect adds roughly 2-4 minutes of visible daylight per day at mid-latitudes. Refraction is stronger at lower temperatures and higher atmospheric pressure. Professional sunrise/sunset tables from organizations like NOAA and the UK Met Office include a standard refraction correction of 0.833 degrees.
What is the equation of time and why does solar noon shift?
The equation of time is the difference between apparent solar time (measured by a sundial) and mean solar time (measured by a clock). It varies throughout the year by up to plus or minus 16 minutes due to two factors: Earth's elliptical orbit (which changes orbital speed) and the obliquity of Earth's axis. In early November, the Sun reaches its highest point about 16 minutes before clock noon; in mid-February, it arrives about 14 minutes after. This is why sunrise and sunset times do not shift symmetrically around the solstices. Use our time zone converter to translate between solar time and local clock time.