Sunrise Sunset Calculator

Enter a date, latitude, longitude, and UTC offset to calculate sunrise time, sunset time, solar noon, and day length using the equation of time and solar declination.

Quick Facts

Hour angle
cos H = cos(90.833°)/(cos φ · cos δ) − tan φ · tan δ
φ = latitude, δ = solar declination; H is the sunrise/sunset hour angle in degrees.
Solar noon
720 − 4L − Eqtime + 60 × UTC offset
Result in minutes after local midnight; L = longitude in degrees (east positive).
Day length
Day length = 8 × H (minutes)
Each degree of hour angle equals 4 minutes of time (360° = 1440 minutes).
Refraction correction
Zenith angle = 90.833°
Accounts for about 34′ of atmospheric refraction plus the Sun's 16′ apparent radius at the horizon.

Your Results

Calculated
Sunrise
-
Local clock time at your UTC offset
Sunset
-
Local clock time at your UTC offset
Solar Noon
-
Sun's highest point in the sky
Day Length
-
Time between sunrise and sunset

Ready

Enter a date, latitude, longitude, and UTC offset, then press Calculate.

Formula and Method for Sunrise and Sunset Times

Earth's axis is tilted about 23.44° from vertical, so as Earth orbits the Sun, the point on the horizon where the Sun rises and sets shifts throughout the year, and the length of daylight changes with latitude and season. The Sun's position relative to any location is described by its declination (δ, its angle north or south of the celestial equator) and the local hour angle (H, how far the Sun has rotated from local solar noon). This calculator uses the standard solar-position series to find δ and the equation of time for your date, then solves for the hour angle at which the Sun crosses the horizon to get sunrise, sunset, solar noon, and day length.

How the calculation works

First, the date is converted to a day-of-year number (N) and a fractional-year angle γ = 2π/365 × (N − 1). Two Fourier-series approximations, accurate to a small fraction of a degree, then give the equation of time (Eqtime, in minutes — the gap between clock time and true solar time caused by Earth's elliptical orbit and axial tilt) and the solar declination (δ). Next the hour angle for sunrise/sunset is solved from cos H = cos(90.833°)/(cos φ · cos δ) − tan φ · tan δ, where φ is latitude and 90.833° is the zenith angle used for the "official" horizon (90° plus about 0.833° for atmospheric refraction and the Sun's apparent size). Solar noon, in minutes after local midnight, is 720 − 4L − Eqtime + 60 × (UTC offset), with longitude L in degrees (east positive). Sunrise is solar noon minus 4H minutes and sunset is solar noon plus 4H minutes, since each degree of hour angle corresponds to 4 minutes of time.

Common mistakes

  • Wrong longitude sign convention: this calculator uses east-positive, west-negative longitude (for example, New York is about -74°, Tokyo is about +140°) — some sources use the opposite sign, so double-check before entering coordinates from another tool.
  • Forgetting daylight saving time: the UTC offset must match your clock on that specific date (for example, -5 for Eastern Standard Time in January but -4 for Eastern Daylight Time in July), not just your region's "standard" zone.
  • Expecting exact agreement with photos or apps: the calculation assumes a flat horizon at sea level; real sunrise/sunset times shift a few minutes (or more) with elevation, local terrain, and buildings that block the horizon.

Real-world applications

  • Photographers and videographers use sunrise/sunset and "golden hour" timing to plan outdoor shoots with warm, low-angle light.
  • Solar energy installers use day length and solar noon to estimate panel output and optimal tilt angle across the year.
  • Hikers, campers, and boaters use sunset time to plan safe return times before darkness falls.
  • Farmers, beekeepers, and wildlife researchers use day length trends to anticipate seasonal behavior tied to daylight hours.

Frequently Asked Questions

How accurate are these sunrise and sunset times?
This calculator uses the standard solar declination and equation-of-time series (accurate to about 0.01°) combined with the hour-angle formula, so results are typically within about 1-2 minutes of published almanac values for most latitudes. It assumes a flat sea-level horizon, so local mountains, buildings, or terrain that block the horizon will shift the sunrise or sunset you actually observe.
Why do I enter a UTC offset instead of picking a timezone by name?
A UTC offset (for example -5 for Eastern Standard Time or -4 for Eastern Daylight Time) lets the calculator convert solar time to your local clock time without guessing whether daylight saving time is in effect. Use the offset that matches your clock on the date you are calculating, not just your time zone's standard offset.
Why isn't solar noon exactly 12:00 PM on my clock?
Solar noon is shifted away from clock noon by two effects: the equation of time (up to about 16 minutes, caused by Earth's elliptical orbit and axial tilt) and your exact longitude within your time zone, since each time zone spans up to 15° of longitude but only one clock time.
What happens at very high latitudes near the poles?
Above roughly 66.5° latitude (the Arctic and Antarctic Circles), the hour-angle equation has no solution for part of the year: the sun stays above the horizon all day (midnight sun) in local summer or below it all day (polar night) in local winter. The calculator flags these cases instead of returning a sunrise or sunset time.