🌅 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.

Free No Signup Required Browser-Based Live Data

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

  1. Enter a city name or latitude/longitude
  2. Select the date
  3. Click "Calculate" to get sun times
  4. 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.

  1. Declination that day: +5.58°. Equation of time: +2.30 minutes
  2. Solar noon: 11:58 UTC
  3. 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.

PhaseSun elevationWhat 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.

Latitude20 March21 June21 December
0° (equator)12h 07m12h 07m12h 07m
51.5° N (London)12h 10m16h 38m7h 50m
33.9° S (Sydney)12h 08m9h 54m14h 25m
64.1° N (Reykjavik)12h 15m21h 06m4h 09m
78° N (Svalbard)12h 30mMidnight sunPolar 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?
Golden hour is the period shortly after sunrise and before sunset when sunlight is softer and warmer. Photographers and filmmakers prize this time for its beautiful lighting quality.
How is astronomical day length calculated?
Day length is calculated using the geographic coordinates (latitude and longitude) and solar declination angle for that specific calendar date.
What are the different twilight phases?
Civil twilight runs until the sun is 6° below the horizon and you can still see comfortably outdoors. Nautical extends to 12°, when the horizon is still discernible at sea. Astronomical extends to 18°, after which the sky is fully dark for observation.
What is the golden hour?
The period shortly after sunrise and before sunset when the sun is low, light is warm and shadows are long. It is a photographic convention rather than a precise interval, and at high latitudes near midsummer it can last for hours.
Why does the earliest sunset not fall on the shortest day?
Because solar noon drifts through the year, an effect captured by the equation of time. The earliest sunset comes a week or two before the winter solstice and the latest sunrise a week or two after, even though the solstice has the least daylight.
Does this account for elevation and terrain?
It calculates for a flat horizon at sea level. A mountain to your west brings practical sunset forward substantially, and being on a summit delays it — so local terrain can shift real-world times by a lot.
Why is sunrise not exactly opposite sunset around noon?
Atmospheric refraction bends light over the horizon, so the sun is visible when it is geometrically still below it. That adds a few minutes at each end, which is also why the day is slightly longer than 12 hours at the equinoxes.
Is anything sent to a server?
Coordinates are needed to calculate solar position, and the page states what it queries.

References & Further Reading

By OnlineToolHubs Team • September 2026