How Is Sunrise Calculated? The Sunrise Equation, Step by Step
Sunrise is when the sun's center sits 0.833 degrees below the horizon. The sunrise equation, a worked New York example, and how accurate calculators are.

Sunrise is calculated by finding the moment the sun’s center reaches 0.833 degrees below a level horizon, which is when the top edge of the disk appears once the atmosphere’s bending of light is counted in. You get that moment from the sun’s declination and your latitude (which give the hour angle), then turn it into clock time using your longitude, the equation of time, and your time zone.
That is the whole recipe. The rest of this page goes through each piece, runs the numbers for New York, and says how close the common algorithms get.
The upper limb definition of sunrise

Sunrise in Telluride Colorado
Sunrise doesn’t wait for the center of the sun. By convention it is the moment the upper limb, the top edge of the disk, appears on the horizon. The sun’s apparent radius is about 16 arcminutes, so at that moment the center is still 16 arcminutes below the horizon line you see.
Using the top edge instead of the center moves sunrise earlier by a minute or a bit more, depending on latitude. Every published sunrise and sunset time uses the upper limb. It also nudges the direction the sun comes up from, which is part of why sunrise is only due east about twice a year.
Atmospheric refraction: why you see the sun early
Air bends light, and it bends it most near the horizon, where sunlight crosses the thickest slice of atmosphere. This atmospheric refraction lifts the sun’s image by about 34 arcminutes at the horizon, a little more than the sun’s whole diameter.
So when you watch the top of the sun appear, the real sun is lower than it looks. Its center sits about 50 arcminutes below the horizon: 34 for refraction plus 16 for the radius. The U.S. Naval Observatory’s definitions page uses exactly those two numbers. The astronomical definitions page covers the related terms.
Refraction changes with temperature and pressure. Cold, dense air bends light more, so on a frigid high-pressure morning the sun shows up a little early. Calculators ignore the weather and use the 34 arcminute average.
The 90.833 degree zenith angle
Add the two corrections and you get 50 arcminutes, or 0.833 degrees. Sunrise algorithms therefore look for the moment the sun’s center reaches a zenith angle of 90.833 degrees (equivalently, an altitude of -0.833 degrees) rather than a flat 90.
That one number carries both the refraction and the upper limb convention. NOAA’s solar calculator and its formula sheet use it, and so do USNO and the SunCalc library this site runs on.
Solar noon and the equation of time
Before you can find sunrise you need solar noon, the moment the sun crosses your meridian and stands highest. Your longitude and time zone fix where solar noon sits on average. On top of that, it drifts through the year for two reasons:
- Earth’s elliptical orbit. Earth moves fastest near perihelion in early January and slowest near aphelion in early July, which speeds up and slows down the sun’s apparent motion.
- Axial tilt. Earth’s 23.44 degree tilt means the sun’s path along the ecliptic sits at an angle to the celestial equator, so its east-west progress varies through the seasons.
The equation of time combines both. It runs from about -14 minutes in mid-February to about +16 minutes in early November. When it is positive, solar noon (and sunrise with it) comes earlier than the even-paced clock would predict.
None of these places changes its clocks, so the wave is the equation of time on its own. Solar noon swings about 31 minutes between mid-February and early November.
- 12:28 pmQuito
- 12:53 pmMumbai
- 1:19 pmSingapore
Show the numbers
| Date | Quito | Mumbai | Singapore |
|---|---|---|---|
| Jan 1, 2026 | 12:18 pm | 12:42 pm | 1:08 pm |
| Jan 15, 2026 | 12:23 pm | 12:48 pm | 1:14 pm |
| Feb 1, 2026 | 12:27 pm | 12:52 pm | 1:18 pm |
| Feb 15, 2026 | 12:28 pm | 12:53 pm | 1:19 pm |
| Mar 1, 2026 | 12:26 pm | 12:51 pm | 1:17 pm |
| Mar 15, 2026 | 12:23 pm | 12:47 pm | 1:14 pm |
| Apr 1, 2026 | 12:18 pm | 12:42 pm | 1:09 pm |
| Apr 15, 2026 | 12:14 pm | 12:39 pm | 1:05 pm |
| May 1, 2026 | 12:11 pm | 12:36 pm | 1:02 pm |
| May 15, 2026 | 12:10 pm | 12:35 pm | 1:01 pm |
| Jun 1, 2026 | 12:12 pm | 12:36 pm | 1:03 pm |
| Jun 15, 2026 | 12:14 pm | 12:39 pm | 1:05 pm |
| Jul 1, 2026 | 12:18 pm | 12:42 pm | 1:09 pm |
| Jul 15, 2026 | 12:20 pm | 12:44 pm | 1:11 pm |
| Aug 1, 2026 | 12:20 pm | 12:45 pm | 1:11 pm |
| Aug 15, 2026 | 12:18 pm | 12:43 pm | 1:09 pm |
| Sep 1, 2026 | 12:14 pm | 12:39 pm | 1:05 pm |
| Sep 15, 2026 | 12:09 pm | 12:34 pm | 1:00 pm |
| Oct 1, 2026 | 12:03 pm | 12:28 pm | 12:54 pm |
| Oct 15, 2026 | 12:00 pm | 12:24 pm | 12:51 pm |
| Nov 1, 2026 | 11:57 am | 12:22 pm | 12:48 pm |
| Nov 15, 2026 | 11:59 am | 12:23 pm | 12:49 pm |
| Dec 1, 2026 | 12:03 pm | 12:27 pm | 12:54 pm |
| Dec 15, 2026 | 12:09 pm | 12:34 pm | 1:00 pm |
Calculated with SunCalc at sea level, in each place's local time. City pages use local terrain and can differ by a few minutes.
The sunrise equation step by step
These steps follow NOAA’s two-page General Solar Position Calculations sheet, which is the simplest version that still gives real clock times.
1. Gather your inputs
- Latitude (φ), your north-south position in degrees.
- Longitude, your east-west position, used to turn solar time into clock time.
- Day of year (n), where January 1 is day 1.
2. Find the sun’s declination (δ)
Declination is how far north or south of the celestial equator the sun sits on a given date. The quick textbook version (Cooper’s approximation) is:
δ = 23.44 × sin[(360/365) × (n + 284)]
It swings between +23.44 degrees at the June solstice and -23.44 degrees at the December solstice. It is right at the solstices and loose around the equinoxes, where it can miss by close to a degree, which is when declination changes fastest. That is fine for a sketch and not for a timetable.
NOAA’s sheet uses a seven-term Fourier series for declination instead, plus a five-term series for the equation of time. Its fractional year is γ = 2π/365 × (n - 1) at noon.
3. Solve for the hour angle (ω)
The hour angle is how far, in degrees, the sun sits from your meridian when it reaches the sunrise altitude:
cos(ω) = [sin(-0.833°) - sin(φ) × sin(δ)] / [cos(φ) × cos(δ)]
NOAA writes the numerator as cos(90.833°), which is the same number. If the right-hand side comes out above 1 or below -1, the sun never reaches that altitude that day. That’s how the equation tells you it’s polar night or midnight sun.
4. Convert to clock time
Earth turns 15 degrees an hour, or 4 minutes per degree. NOAA’s sheet puts it all in one line:
sunrise (UTC minutes) = 720 - 4 × (longitude + ω) - equation of time
Sunset uses the same formula with the sign of ω flipped, and solar noon drops ω entirely.
Two things about that formula trip people up. Longitude is positive east of Greenwich, so every US longitude goes in as a negative number. And the answer is in UTC minutes after midnight, so you still apply your time zone offset and any daylight saving.
A worked example for New York
Here is NOAA’s sheet run end to end for New York City on June 21, 2026: latitude 40.7128, longitude -74.0060, day of year 172. The last column is the U.S. Naval Observatory’s published time for the same place and day, which USNO rounds to the minute.
| Step | NOAA sheet | USNO |
|---|---|---|
| Fractional year γ | 2.9436 rad | |
| Equation of time | -1.33 min | |
| Solar declination | 23.452° | |
| Hour angle | 113.217° | |
| Solar noon | 16:57:21 UTC (12:57 PM EDT) | 16:58 UTC |
| Sunrise | 09:24:29 UTC (5:24 AM EDT) | 09:25 UTC |
| Sunset | 00:30:13 UTC on June 22 (8:30 PM EDT) | 00:31 UTC |
Day length falls out of the hour angle for free: 2 × 113.217 / 15 = 15.10 hours, or 15h 06m.
Sunset lands on the next calendar day in UTC. That catches almost everyone writing this in code for the first time, and it causes off-by-one-day bugs for every location west of Greenwich.
Solar noon is 12:57 PM, and most of that is bookkeeping. A full hour is daylight saving. Strip it off and solar noon is 11:57 AM standard time, a few minutes early, because New York sits about a degree east of its zone’s 75°W reference meridian (4 minutes). The equation of time pulls back a little over a minute in the other direction.
The sheet lands about half a minute early here. It isn’t always that close. Its declination series is loosest around the equinoxes, and when we ran it against USNO-accurate times for every day of 2026, its sunset in New York ran up to about 2.5 minutes late in late August, and London’s was off by about 3 minutes. For timetable accuracy you need the full Meeus algorithm, not a tidier arrangement of this one.
If you’d rather not implement any of it, the free JSON API returns these times for any coordinates and date:
GET https://api.sunrisesunset.io/json?lat=40.7128&lng=-74.0060&date=2026-06-21
Leave the elevation parameter off and the API uses the ground elevation at those coordinates, which shifts the times (see the elevation section below). Add elevation=0 to match USNO’s sea-level figures.
How sunrise is calculated at sea
Ships work from the Nautical Almanac rather than solving the equation. Its daily pages list the local mean time of sunrise, sunset, and civil and nautical twilight for latitudes from 72°N to 60°S, as Bowditch’s chapter on the almanacs describes. A navigator interpolates for the ship’s latitude, then converts to UT by adding 4 minutes for every degree of west longitude (subtracting for east). The tabulated times assume a sea-level eye. From a high bridge you see the sun slightly earlier, for the same reason a mountaintop does.
Factors that shift sunrise time
The formula already handles latitude, date, and longitude. A few real-world factors move the sunrise you actually see:
- Latitude: near the equator sunrise barely moves through the year, while at high latitudes it can shift by hours, or not happen at all.
- Position within a time zone: two cities on the same clock can have sunrises 30 or more minutes apart if one sits near the eastern edge of the zone and the other near the western edge.
- Elevation: from high up you see past the curve of the Earth, so the sun appears sooner. How elevation affects sunrise and sunset times works through the numbers.
- Weather: temperature layers near the ground change refraction. Usually this moves the visible sunrise by well under a minute, but in polar air it can be far more.
- Terrain: no standard calculator knows about the hill or building in front of you.
Common algorithms and how accurate they are
- NOAA Solar Calculator: built on equations from Jean Meeus’ Astronomical Algorithms. NOAA says its sunrise and sunset results are “theoretically accurate to within a minute” between 72°N and 72°S and within 10 minutes outside that band. NOAA also notes the calculator is no longer maintained.
- NOAA’s formula sheet: the simplified version used in the worked example above. Good for learning, and a few minutes off at worst in our 2026 check.
- U.S. Naval Observatory: publishes the reference tables many agencies use, rounded to the minute, for a sea-level observer with a level horizon.
- The Almanac for Computers routine: a 1990 USNO algorithm, widely copied from Ed Williams’ website. It uses the same 90.833 degree zenith with simpler solar position terms.
- SunriseSunset.io: our site and API use the open-source SunCalc library (version 2). It solves rise and set times with Meeus’ rising and setting method (chapter 15) and his solar coordinates (chapter 25), and its documentation reports typical rise and set errors of about 15 seconds against USNO. Spot checks we ran for New York, London, Fairbanks, Quito, and Sydney in 2026 matched USNO’s published minute every time. The API also adds an elevation correction by default, which USNO and NOAA don’t.
All of these share the same geometry. They differ in how precisely they model the sun’s position and in how they treat elevation and the polar edge cases.
Frequently asked questions
Does elevation affect sunrise time?
Yes, when your horizon is well below you. At 1,000 meters (about 3,280 feet) with open view down to sea level, sunrise comes about 6 minutes earlier at 40 degrees latitude around the equinoxes and about 4.5 minutes earlier near the equator.
The effect grows with the square root of height, so any “one minute per X meters” rule is wrong by construction. On a high plateau where the ground around you is just as high, you get almost none of it. The numbers are worked through in how elevation affects sunset times.
Why is the sun red or orange at sunrise?
Near the horizon the sun’s light crosses far more air than at midday. Air molecules scatter blue and violet light out of the beam, leaving the reds and oranges. Dust, smoke, and haze can deepen the color.
Why does sunrise time change throughout the year?
Earth’s axis is tilted 23.44 degrees to its orbit, so the sun’s declination changes through the year. When the sun is on your hemisphere’s side of the equator it follows a longer, higher arc and rises earlier. In winter the arc is shorter and lower, so sunrise comes later. The equation of time adds a smaller wobble, which is why the latest sunrise doesn’t fall on the shortest day.
How accurate are sunrise calculators?
The math in a good calculator (NOAA’s online tool, USNO, SunCalc) is accurate to well under a minute for most of the world. The atmosphere is the bigger limit. Refraction on a given morning can differ from the 34 arcminute average, so the sun you actually see can come up a minute or so off the prediction, and much more in cold polar air. Calculators also assume a level horizon, so mountains or buildings in the way will delay your view of the sun.
What is the difference between sunrise and dawn?
Sunrise is the instant the top of the sun appears. Dawn comes earlier, when the sky starts to brighten. Civil dawn begins when the sun’s center is 6 degrees below the horizon, nautical dawn at 12 degrees, and astronomical dawn at 18 degrees. In the evening the same thresholds mark the end of each stage of twilight.