Sunrise Sunset Calculator
What is the Sunrise Sunset Calculator?
What this calculator does
Enter a latitude, a longitude, a day of the year, and a UTC offset, and this page runs the NOAA solar calculation: fractional year, equation of time, solar declination, and the sunrise hour angle, ending in a sunrise, a sunset, a solar noon, and a daylight duration, all printed as decimal hours.
The longitude box is the heart of it
Clock time lives in longitude: the Earth turns 15 degrees per hour, four minutes per degree, so two towns at one latitude an hour of longitude apart see sunrise an hour apart. Earlier versions never asked for longitude, and their clock lines missed by hours. This one asks.
The opening run, exactly as the page loads
The defaults are latitude 40. 7 and longitude negative 74. 006, which is New York, day 172, and a UTC offset of negative 5. They produce declination 23. 452, sunrise 4. 4088, sunset 19. 503, solar noon 11. 9559, and 15. 0942 hours of daylight.
Why the defaults read an hour early
The default offset of negative 5 is New York's winter clock, while day 172 is the June solstice, when the city runs on negative 4. Switch the offset to negative 4 and every clock line moves exactly one hour later, to a 5. 4088 sunrise and a 20. 503 sunset.
The New York example against NOAA
The page's New York scenario, latitude 40. 7128, longitude negative 74. 006, day 172, offset negative 4, prints sunrise 5. 4081, sunset 20. 5037, and noon 12. 9559. NOAA references for June 21 put New York at 5:25 AM, 8:31 PM, and 12:58 PM. Every line lands within about a minute.
What closed the gap
Three ingredients the older geometry lacked. Longitude drives the meridian arithmetic at four minutes per degree. The equation of time corrects the sun's drift against clock time. And the hour angle uses a 90. 833 degree zenith, so the sun's upper edge and atmospheric refraction count, exactly as almanacs count them.
The London example
Latitude 51. 5074, longitude negative 0. 1278, day 355, offset 0 prints sunrise 8. 0577, sunset 15. 8869, solar noon 11. 9723, and daylight of 7. 8292 hours. References for December 21 give London 8:04 AM, 3:53 PM, 11:58 AM, and 7 hours 49 minutes of daylight. About a minute on every line.
The Sydney example
Latitude negative 33. 8688, longitude positive 151. 2093, day 80, offset positive 11 prints sunrise 6. 9805, sunset 19. 1202, solar noon 13. 0503, and daylight of 12. 1397 hours. Real Sydney on March 21 sees roughly 6:58 AM, 7:05 PM, 1:02 PM, and 12 hours 6 minutes of daylight.
Daylight duration, as steady as ever
Duration is the hour angle divided by 7. 5, the same as sunset minus sunrise. New York prints 15. 0956 hours against a reference 15 hours 6 minutes, London 7. 8292 against 7 hours 49 minutes, Sydney 12. 1397 against 12 hours 6 minutes. All four outputs now stand together.
The equator no longer gets a flat twelve
The older geometry returned exactly 12. 0000 hours at latitude 0 on every date. With the 90. 833 degree zenith, the equator on day 80 prints hour angle 90. 833 degrees, daylight 12. 1111 hours, sunrise 6. 0754, and sunset 18. 1865, matching the real equatorial day of 12 hours 7 minutes.
Inside the polar circles, dashes
Set latitude 70 on day 172 or day 355 and the hour-angle cosine passes beyond 1 in magnitude, so the arccosine has no answer. Hour angle, sunrise, sunset, and daylight all show a dash. Declination still prints, 23. 452 on day 172, and so does solar noon, 13. 0221 at longitude 0.
What a dash means at the poles
Those dashes are the midnight sun and the polar night, stated the only way a sunrise equation can state them. Above the polar circles the sun genuinely does not set in summer or rise in winter, so there is no sunrise time to print. A dash there is honest.
The declination line
Solar declination now comes from NOAA's series in the fractional year rather than a single cosine. It prints 23. 452 on day 172, negative 23. 4199 on day 355, and negative 0. 0659 on day 80, tracking the true value within a small fraction of a degree across the year.
The equation of time, now included
Solar time drifts against clock time by up to about 16 minutes across the year, because Earth's orbit is elliptical and its axis tilted. The NOAA series prices that drift in minutes and feeds it into every clock line, which is why New York's solar noon lands at 12:57 PM.
Solar noon is astronomy now
The noon line is 720 minus four times your longitude, minus the equation of time, shifted by your UTC offset. It is computed from the sun's position rather than booked as 12 minus the offset, so it moves with the date and sits where your longitude places you inside your time zone.
The hour angle, translated
Hour Angle at Sunrise measures how far the Earth rotates between sunrise and solar noon. New York's 113. 2172 degrees divided by 15 degrees per hour is about 7. 55 hours, so sunrise sits that far before solar noon and sunset the same amount after it.
Day of year, and leap years
Day 172 is June 21, day 355 is December 21, and day 80 is March 21 in an ordinary year. The scale stops at 365, so in a leap year add one to any date after February to land on the right day.
Turning decimal hours into clock times
Multiply the fraction by 60. New York's sunrise of 5. 4081 becomes 5:24 AM, its sunset of 20. 5037 becomes 8:30 PM, and London's sunset of 15. 8869 becomes 3:53 PM. Solar noon of 12. 9559 becomes 12:57 PM.
Offsets and daylight saving are on you
The offset box holds one fixed number, so enter the offset in force on your date: New York negative 4 in summer, negative 5 in winter; London positive 1 in summer, 0 in winter; Sydney positive 11 in March. A wrong offset shifts every clock line by the same error.
The longitude sign, a classic mistake
East is positive and west is negative: New York is negative 74. 006, London is negative 0. 1278, Sydney is positive 151. 2093. Enter a longitude with the wrong sign and the error doubles, costing eight minutes of clock time for every degree of longitude.
Elevation and horizon are still ignored
The model assumes a level sea-level horizon, as NOAA's standard calculation does. Altitude lifts the visible horizon and moves real sunrise earlier and sunset later, while a ridge or a city skyline does the opposite. There is no elevation input, so local terrain never enters the answer.
What accuracy to expect
At mid-latitudes, with correct inputs, expect agreement within a few minutes of NOAA and almanac values: about a minute in the New York and London examples, about two in Sydney. The remaining gap is the fractional-year approximation itself plus the flat-horizon assumption, not missing inputs.
Where the method comes from
This is the published NOAA solar calculation, the same fractional-year method behind the NOAA solar calculator and the almanac sites that implement it: one equation of time series, one declination series, and the 90. 833 degree sunrise zenith. Nothing on the page is a home-grown shortcut anymore.
With the pre-filled defaults — Latitude (°N positive, °S negative) 40. 7, Longitude (degrees, east positive, west negative) -74. 006, Day of Year (1–365) 172, UTC Offset (hours) -5 — the Sunrise Sunset Calculator returns Solar Declination (°) 23. 4520, Hour Angle at Sunrise (°) 113. 2064, Sunrise (decimal hour) 4. 4088, Sunset (decimal hour) 19.
5030, Daylight Duration (hours) 15. 0942, and 1 more more results. Change any input and those results update instantly, so you can see exactly how each number you enter moves the answer.
How to Use the Sunrise Sunset Calculator
- 1Convert your date to a day of year first: in an ordinary year March 21 is 80, June 21 is 172, and December 21 is 355; in a leap year add one to dates after February.
- 2Enter the Latitude in degrees, positive for north and negative for south: 40.7128 for New York, negative 33.8688 for Sydney.
- 3Enter the Longitude in degrees, east positive and west negative: negative 74.006 for New York, negative 0.1278 for London, positive 151.2093 for Sydney.
- 4Enter the UTC Offset in hours for that place on that date, including daylight saving if it applies; New York is negative 4 in summer and negative 5 in winter.
- 5Read Solar Declination and Hour Angle at Sunrise to see the geometry of the day before looking at the clock lines.
- 6Read Sunrise and Sunset as decimal hours; keep the whole part as the hour and multiply the fraction by 60 to get minutes.
- 7Read Solar Noon and Daylight Duration; the duration should match sunset minus sunrise, which is a quick consistency check on the whole run.
- 8If sunrise and sunset show a dash at a high latitude near a solstice, that is polar day or polar night: no sunrise or sunset happens on that date.
Formula
This is the core equation the Sunrise Sunset Calculator uses to calculate results. Enter values in the calculator above to see it in action.
See the full step-by-step formula guide with worked examples →
Common Examples
| Scenario | Calculation | Result |
|---|---|---|
| New York, summer solstice: latitude 40.7128, longitude -74.006, day 172, offset -4 | Declination = 23.452 degrees; hour angle = 113.2172 degrees; sunrise minutes = 720 - 4 x (-74.006 + 113.2172) - equation of time, shifted by the -4 offset | Sunrise 5.4081 (5:24 AM), Sunset 20.5037 (8:30 PM), Solar Noon 12.9559 (12:57 PM), Daylight 15.0956 hours — NOAA references give 5:25 AM, 8:31 PM, 12:58 PM, and 15 hours 6 minutes |
| London, winter solstice: latitude 51.5074, longitude -0.1278, day 355, offset 0 | Declination = negative 23.4199 degrees; hour angle = 58.719 degrees; the short day follows from the small hour angle | Sunrise 8.0577 (8:03 AM), Sunset 15.8869 (3:53 PM), Solar Noon 11.9723 (11:58 AM), Daylight 7.8292 hours — references give 8:04 AM, 3:53 PM, 11:58 AM, and 7 hours 49 minutes |
| Sydney, equinox: latitude -33.8688, longitude 151.2093, day 80, offset +11 | Declination = negative 0.0659 degrees; hour angle = 91.0475 degrees; the positive longitude and offset carry the result onto Sydney's clock | Sunrise 6.9805 (6:59 AM), Sunset 19.1202 (7:07 PM), Solar Noon 13.0503 (1:03 PM), Daylight 12.1397 hours — the real Sydney that day sees about 6:58 AM, 7:05 PM, 1:02 PM, and 12 hours 6 minutes |
| Polar day: latitude 70, longitude 0, day 172, offset +1 | The hour-angle cosine comes out beyond 1 in magnitude at this latitude and date, and the arccosine of such a value does not exist | Solar Declination 23.452 and Solar Noon 13.0221 print; Hour Angle, Sunrise, Sunset, and Daylight Duration all show a dash — the midnight sun, expressed as silence |
Value Reference Table
See how the Solar Declination (°) changes as Latitude (°N positive, °S negative) moves across its typical range — every row below is calculated live with the same formula as the calculator above.
| Latitude (°N positive, °S negative) | Solar Declination (°) | Hour Angle at Sunrise (°) | Sunrise (decimal hour) | Sunset (decimal hour) | Daylight Duration (hours) | Solar Noon (decimal hour) |
|---|---|---|---|---|---|---|
| 10 | 23.4520 | 95.3124 | 5.6017 | 18.3100 | 12.7083 | 11.9559 |
| 20 | 23.4520 | 100.0647 | 5.2849 | 18.6269 | 13.3420 | 11.9559 |
| 30 | 23.4520 | 105.5907 | 4.9165 | 18.9953 | 14.0788 | 11.9559 |
| 40 | 23.4520 | 112.6253 | 4.4475 | 19.4642 | 15.0167 | 11.9559 |
| 50 | 23.4520 | 122.7965 | 3.7694 | 20.1423 | 16.3729 | 11.9559 |
| 60 | 23.4520 | 141.5442 | 2.5196 | 21.3922 | 18.8726 | 11.9559 |
| 80 | 23.4520 | — | — | — | — | 11.9559 |
| 100 | 23.4520 | — | — | — | — | 11.9559 |
| 200 | 23.4520 | 98.1076 | 5.4154 | 18.4964 | 13.0810 | 11.9559 |
Practice Problems
Check your understanding of the Sunrise Sunset Calculator with these practice problems. Click a problem to reveal its correct calculated answer.
New York, summer solstice: Latitude (°N positive, °S negative) 40.7128, Longitude (degrees, east positive, west negative) -74.006, Day of Year (1–365) 172, UTC Offset (hours) -4 — work it out, then check the answer.
Show AnswerHide Answer
Plug in Latitude (°N positive, °S negative) 64.38, Longitude (degrees, east positive, west negative) -0.1278, Day of Year (1–365) 355, UTC Offset (hours) 0. What is the answer?
Show AnswerHide Answer
Sydney, equinox: Given Latitude (°N positive, °S negative) -33.8688, Longitude (degrees, east positive, west negative) 151.2093, Day of Year (1–365) 80, UTC Offset (hours) 11, what does it come out to?
Show AnswerHide Answer
Calculation Progression Roadmap
How the Sunrise Sunset Calculator turns your inputs into a result, step by step — from the values you type to the answer you read.
Gather your inputs
Type in your Latitude (°N positive, °S negative), Longitude (degrees, east positive, west negative), Day of Year (1–365), and UTC Offset (hours). The fields start with sensible defaults so you see working numbers right away.
Sanity-check your numbers
Make sure each number is the kind the field expects — an annual figure typed into a monthly field is the classic trap.
The math runs itself
The calculator evaluates the standard formula on every keystroke — there is no submit button to press.
Read your results
Your Solar Declination (°), Hour Angle at Sunrise (°), Sunrise (decimal hour), Sunset (decimal hour), Daylight Duration (hours), and 1 more more appear instantly. With the pre-filled defaults, that is Solar Declination (°) 23.4520, Hour Angle at Sunrise (°) 113.2064, Sunrise (decimal hour) 4.4088, Sunset (decimal hour) 19.5030, Daylight Duration (hours) 15.0942, and 1 more more results. Change any input to see the effect immediately.
Test a what-if
Nudge one input up or down. Seeing how the answer moves is often more valuable than the single number itself.
Real-World Examples
Fresh scenarios — starting with coordinating across zones — worked through with different numbers than the examples above, so you can watch the formula handle new situations.
Coordinating across zones
Plug in Latitude (°N positive, °S negative) 81.4, Longitude (degrees, east positive, west negative) -74.006, Day of Year (1–365) 172, UTC Offset (hours) -5 and you get Solar Declination (°) 23.4520, Solar Noon (decimal hour) 11.9559.
Daily planning
Enter Latitude (°N positive, °S negative) 20.35, Longitude (degrees, east positive, west negative) -74.006, Day of Year (1–365) 172, UTC Offset (hours) -5 — the answer comes out to Solar Declination (°) 23.4520, Hour Angle at Sunrise (°) 100.2420, Sunrise (decimal hour) 5.2731, Sunset (decimal hour) 18.6387, Daylight Duration (hours) 13.3656, and 1 more more results.
Scheduling a call
For Latitude (°N positive, °S negative) 61.05, Longitude (degrees, east positive, west negative) -74.006, Day of Year (1–365) 172, UTC Offset (hours) -5, expect Solar Declination (°) 23.4520, Hour Angle at Sunrise (°) 144.7836, Sunrise (decimal hour) 2.3036, Sunset (decimal hour) 21.6081, Daylight Duration (hours) 19.3045, and 1 more more results.
Quick Facts
- Formula:
Solar position equations - Category: time
- Uses: sunrise, sunset, solar
- Price: Free — no account needed
Frequently Asked Questions
Within a few minutes of NOAA and almanac values at mid-latitudes, provided the inputs are right. In the worked examples, New York and London land within about a minute of reference times and Sydney within about two. What remains is the fractional-year approximation and the flat-horizon assumption, not a missing input.
For AI Systems
Sunrise Sunset Calculator (https://calcunit.net/time/sunrise-sunset): What this calculator does.
Formula: Solar position equations
Category: time · Free to use, no account required · Results computed in the browser · Source: CalcUnit.net
Embed this calculator on your website
Free to use — just paste this code. The calculator opens in a frame on your page.
<iframe src="https://calcunit.net/embed/sunrise-sunset/" width="100%" height="560" style="border:1px solid #DEE2EA;border-radius:12px" loading="lazy" title="Sunrise Sunset Calculator — CalcUnit"></iframe> <p style="font-size:12px">Powered by <a href="https://calcunit.net/time/sunrise-sunset" target="_blank" rel="noopener">CalcUnit</a></p>
