🌅 Sunrise & Sunset Calculator
Find sunrise and sunset times for any location and date. Calculate day length and golden hour. Free tool powered by Sunrise-Sunset API.
What Sunrise & Sunset Calculator Does
Sunrise and sunset are arithmetic, not a lookup. Given a date, a latitude and a longitude, the sun's position follows from the Earth's orbit and tilt, and the times fall out of it. That is worth saying because most sunrise pages call an API to get the answer, which means they stop working when someone else's server does — this one computes it in your browser and needs no network at all.
What counts as "sunrise" is a convention rather than an observation. The standard is the moment the sun's upper edge touches the horizon, which happens when the center of the sun is 0.833° below it: 0.267° for the sun's own radius and about 0.567° for atmospheric refraction bending the light over the horizon. Without refraction, sunrise would be several minutes later and sunset several minutes earlier.
That single figure explains why day and night are not equal at the equinox. On 20 March the day runs 12 hours 7 minutes at the equator and 12 hours 10 minutes in London — over twelve, everywhere, because the sun is already visible before its center reaches the horizon and still visible after it has passed.
Twilight is the same calculation at different depths: civil at 6° below the horizon, nautical at 12°, astronomical at 18°. Those are not arbitrary either — civil is roughly the point at which you need artificial light to work outdoors, nautical the point at which the sea horizon becomes indistinct, and astronomical the point beyond which the sky is dark enough for faint objects.
How to Use Sunrise & Sunset Calculator
- Enter a city name or latitude/longitude
- Select the date
- Click "Calculate" to get sun times
- View sunrise, sunset, day length, and golden hour
Formula Used by Sunrise & Sunset Calculator
Hour angle from the sun's declination
cos(H) = [cos(90° − elevation) − sin(lat)·sin(δ)] ÷ [cos(lat)·cos(δ)]; sunrise = solar noon − 4H minutes
- δ
- the sun's declination — how far north or south it stands, swinging ±23.44° over the year
- H
- the hour angle in degrees; the Earth turns 15° an hour, so one degree is four minutes
- elevation
- −0.833° for sunrise, −6° civil, −12° nautical, −18° astronomical
- no solution
- if the fraction falls outside ±1 the sun never reaches that elevation — midnight sun or polar night
Worked example
London, 51.51° N, on 8 September 2026.
- Declination that day: +5.58°. Equation of time: +2.30 minutes
- Solar noon: 11:58 UTC
- Hour angle for −0.833°: 98.4°, which is 6 hours 34 minutes
Result: Sunrise 05:24, sunset 18:31 UTC — matching published tables to the minute.
The twilight thresholds
All the same calculation, run at different sun elevations.
| Phase | Sun elevation | What it means |
|---|---|---|
| Astronomical twilight | −18° | The sky reaches full darkness; faint objects become observable |
| Nautical twilight | −12° | The sea horizon is still discernible for sextant work |
| Civil twilight | −6° | Enough natural light to work outdoors without lamps |
| Sunrise and sunset | −0.833° | Upper edge of the sun on the horizon, refraction included |
| Golden hour | −4° to +6° | Warm, low light with long shadows |
Day length through the year
Computed for 0° longitude. The equinox figure exceeds twelve hours everywhere, because of the horizon allowance.
| Latitude | 20 March | 21 June | 21 December |
|---|---|---|---|
| 0° (equator) | 12h 07m | 12h 07m | 12h 07m |
| 51.5° N (London) | 12h 10m | 16h 38m | 7h 50m |
| 33.9° S (Sydney) | 12h 08m | 9h 54m | 14h 25m |
| 64.1° N (Reykjavik) | 12h 15m | 21h 06m | 4h 09m |
| 78° N (Svalbard) | 12h 30m | Midnight sun | Polar night |
How to Read Your Result
Earliest sunset is not the shortest day
In the northern mid-latitudes the earliest sunset falls in early December and the latest sunrise in early January, with the solstice between them. The cause is the equation of time: the Earth's orbit is elliptical and its axis tilted, so solar noon drifts against clock noon by up to about sixteen minutes over the year. Solar noon is shown here for exactly that reason.
The horizon in the formula is at sea level
Altitude brings sunrise forward and pushes sunset back — noticeably so from a mountain or an aircraft. Hills, buildings and trees do the opposite. Anyone planning a shot from a specific spot should treat these times as the astronomical bound rather than what they will actually see.
Accuracy degrades towards the poles
Near the equator the sun crosses the horizon almost vertically, so a small error in elevation is a small error in time. At high latitude it crosses at a shallow angle and the same elevation error becomes minutes. Around the polar circles, close to the solstices, a day either side can change the answer from a sunrise to none at all.
Limitations & Accuracy Notes
- Sea-level horizon assumed; altitude and terrain both shift the real times.
- Refraction is the standard 0.833° allowance, which is a convention. Actual refraction varies with temperature and pressure and can differ by minutes in unusual conditions.
- Accurate to about a minute in the mid-latitudes, degrading near the poles.
- The bundled city list is curated, not exhaustive; coordinates can be entered directly for anywhere else.
- Times are shown in the selected city's timezone using your browser's timezone data, including its daylight-saving rules.
Frequently Asked Questions
What is golden hour?
How is astronomical day length calculated?
What are the different twilight phases?
What is the golden hour?
Why does the earliest sunset not fall on the shortest day?
Does this account for elevation and terrain?
Why is sunrise not exactly opposite sunset around noon?
Is anything sent to a server?
References & Further Reading
- NOAA Global Monitoring Laboratory — solar calculator — The equations implemented here, and a reference implementation to check against