How is Sunrise Calculated? (Refraction, Algorithms, and Math)

Sunrise is the moment the top edge of the sun’s disk touches the horizon. That simple definition hides a surprising amount of math. To predict when sunrise happens at any location on any date, you need the observer’s coordinates, the sun’s position in space, and a correction for how Earth’s atmosphere bends light.

Here is how that calculation works, from the geometry to the final clock time.


The Upper Limb Definition of Sunrise

Sunrise over the mountains in Telluride, Colorado
Sunrise in Telluride Colorado

Sunrise does not mean the center of the sun sits on the horizon. By international convention, sunrise occurs when the upper limb (the top edge) of the sun’s disk first appears above the geometric horizon. The sun’s apparent radius is about 16 arcminutes. So the sun’s center is still 16 arcminutes below the horizon at the official moment of sunrise.

This distinction matters because it shifts the calculated time by roughly one minute compared to a center-of-disk definition. Every sunrise and sunset time you see published uses this upper limb standard.


Atmospheric Refraction: Why You See the Sun Early

Earth’s atmosphere bends sunlight. When the sun is near the horizon, its light passes through the thickest layer of air. This bending (called atmospheric refraction) lifts the sun’s apparent position by about 34 arcminutes on average.

In practical terms, you see the sun before it has geometrically cleared the horizon. At the moment of visible sunrise, the true center of the sun still sits about 50 arcminutes below the horizon: 34 arcminutes from refraction plus 16 arcminutes for the solar radius. To learn more about how these astronomical definitions work together, check our reference page.

Refraction varies with temperature and air pressure. On a cold, high-pressure morning, the atmosphere bends light more, and sunrise appears slightly earlier. Standard calculations use the average value of 34 arcminutes rather than adjusting for daily weather.


The 90.833 Degree Zenith Angle

Combining the upper limb offset (16 arcminutes) and atmospheric refraction (34 arcminutes) gives a total correction of 50 arcminutes, which equals 0.833 degrees. Standard sunrise algorithms set the solar zenith angle to 90.833 degrees instead of a flat 90.

In other words, sunrise is defined as the moment when the sun’s geometric center reaches a zenith angle of 90.833 degrees. This single number bakes in both the refraction adjustment and the upper limb convention. Every major source, including NOAA’s solar calculator and the U.S. Naval Observatory, uses this value.


Solar Noon and the Equation of Time

Before you can find sunrise, you need to know when the sun crosses the local meridian (solar noon). Solar noon is not always 12:00 on your clock. Two factors cause it to drift:

  1. Earth’s elliptical orbit: Earth moves faster when closer to the sun (perihelion in early January) and slower when farther away (aphelion in early July). This speeds up or slows down the sun’s apparent motion across the sky.
  2. Axial tilt (obliquity): Earth’s 23.44 degree tilt means the sun’s path along the ecliptic is angled relative to the celestial equator. The sun’s east-west speed varies as it moves north and south through the seasons.

The Equation of Time captures both effects in a single correction. It ranges from about minus 14 minutes to plus 16 minutes over the course of a year. On days when the Equation of Time is positive, solar noon arrives before clock noon, and sunrise shifts earlier too.


The Sunrise Formula Step by Step

Here is a simplified walkthrough of the math behind sunrise. Most online calculators (including the one on this site) follow this sequence:

1. Gather Your Inputs

  • Latitude (φ): Your north-south position on Earth, in degrees.
  • Longitude: Your east-west position, used to convert solar time to clock time.
  • Day of year (n): January 1 = day 1, December 31 = day 365 (or 366).

2. Calculate the Sun’s Declination (δ)

The sun’s declination is how far north or south of the celestial equator the sun sits on a given date. A common approximation is:

δ = 23.44 × sin[(360/365) × (n + 284)]

This value swings from +23.44 degrees at the summer solstice to minus 23.44 degrees at the winter solstice.

3. Solve for the Hour Angle (ω)

The hour angle tells you how far (in degrees) the sun must travel from the meridian to reach the horizon. The core equation is:

cos(ω) = [sin(−0.833°) − sin(φ) × sin(δ)] / [cos(φ) × cos(δ)]

The −0.833° in the numerator is the combined refraction and upper limb correction discussed above. If this formula returns a value outside the range of −1 to 1, the sun does not rise (or does not set) at that latitude on that date. This is how you detect polar day or polar night.

4. Convert to Clock Time

Earth rotates 15 degrees per hour. Divide the hour angle by 15 to get hours before solar noon. Then apply three adjustments:

  1. Subtract the hour angle (in hours) from 12:00 solar noon.
  2. Apply the Equation of Time correction for the date.
  3. Adjust for the difference between your longitude and your time zone’s reference meridian.

As NOAA’s formula sheet puts it: sunrise (UTC minutes) = 720 − 4 × (longitude + hour angle) − Equation of Time.


Factors That Shift Sunrise Time

Beyond the core formula, several real-world factors push sunrise earlier or later:

  • Latitude: Near the equator, sunrise changes little across the year. At high latitudes, the difference between summer and winter sunrise can be several hours (or the sun may not rise at all).
  • Longitude within a time zone: Two cities in the same time zone can have sunrise times that differ by 30 minutes or more if one sits on the eastern edge and the other on the western edge.
  • Elevation: Standing higher gives you a longer line of sight to the horizon. A person on a mountaintop sees the sun before someone at sea level. Our guide on how elevation affects sunrise and sunset times explains the geometry behind this correction.
  • Local weather: Temperature inversions and humidity change the refractive index of the atmosphere. On rare occasions this can shift the visible sunrise by a minute or two compared to the standard prediction.

Common Algorithms and Tools

Several well-known algorithms power sunrise calculators around the world:

  • NOAA Solar Calculator: Uses equations from Jean Meeus’ book “Astronomical Algorithms.” Accurate to within about one minute for most locations.
  • U.S. Naval Observatory (USNO): Publishes annual tables and an online calculator. Their data is the standard reference for many government agencies.
  • Ed Williams’ algorithm: A simplified algorithm popular among programmers. It follows the same zenith angle of 90.833 degrees and produces results within a minute of NOAA’s.
  • SunriseSunset.io: Our own calculator uses NOAA-based equations and accounts for latitude, longitude, elevation, and time zone automatically.

All of these tools share the same core math. The differences come from how precisely they model the sun’s orbital elements and how they handle edge cases like polar regions.


Frequently Asked Questions

Does elevation affect sunrise time?

Yes. Higher elevation gives you a wider view of the horizon, so you see the sun sooner. At 1,000 meters (about 3,280 feet) above sea level, sunrise occurs roughly 3 to 4 minutes earlier than at sea level. The exact difference depends on latitude and atmospheric conditions. See the elevation section above for more detail.

Why is the sun red or orange at sunrise?

When the sun is near the horizon, its light passes through a much thicker slice of atmosphere than at midday. Shorter wavelengths (blue and violet) scatter away, leaving longer wavelengths (red and orange) to reach your eyes. Dust, smoke, and humidity can intensify the color.

Why does sunrise time change throughout the year?

Earth’s axis is tilted 23.44 degrees relative to its orbital plane. As Earth orbits the sun, this tilt changes the sun’s declination. In summer, the sun rises earlier because it follows a higher, longer arc across the sky. In winter, the arc is lower and shorter, so sunrise comes later.

How accurate are sunrise calculators?

Most modern calculators (NOAA, USNO, SunriseSunset.io) are accurate to within one to two minutes under normal atmospheric conditions. Extreme weather, unusual terrain, or very high latitudes can increase the error. No calculator accounts for local obstructions like mountains or buildings blocking your specific horizon.

What is the difference between sunrise and dawn?

Sunrise is the instant the top edge of the sun appears above the horizon. Dawn (also called twilight) starts earlier, when the sky first begins to brighten. Civil dawn begins when the sun is 6 degrees below the horizon. Nautical dawn starts at 12 degrees below, and astronomical dawn at 18 degrees below. The same twilight stages apply in reverse at sunrise.

Leave a Comment