Sunrise and Sunset Calculator
Doing this by hand means the solar position equations and half an hour with a calculator, which is why most people guess. Give a place and a date and you get sunrise, sunset, the moment each twilight begins, when the golden hour opens and closes, and how much daylight there is between the two ends of the day.
What this generator does
Computes the sun's declination and the equation of time for the date, then solves for the moment the sun crosses each of the angles that define sunrise, the twilights and the golden hour.
How to use this tool
- Pick a place from the list, or type a latitude and longitude.
- Choose the date and how many hours ahead of UTC to show times in.
- Read the sunrise, sunset, twilights and golden hour.
- Copy the whole set if you are planning around them.
Understanding the controls
- Somewhere to start from
- A short list of places that fills in the coordinates and time zone for you. Everything is worked out from the numbers, so anywhere on Earth can be typed in instead.
- Date
- Any date, past or future. The formulae are quoted as good to about a minute across the present century, which is finer than the day-to-day variation from the atmosphere.
- Latitude
- Degrees north of the equator, written negative for south. Above about 66 degrees the sun stops rising or setting at midsummer and midwinter, and the page says so rather than showing a made-up time.
- Longitude
- Degrees east of Greenwich, written negative for west. This is what shifts solar noon away from twelve o'clock.
- Hours ahead of UTC
- The offset the times are shown in — one for British Summer Time, zero for GMT. Daylight saving is not applied for you, because when it starts differs by country.
Common use cases
- Planning a photograph for the golden hour rather than guessing at it
- Working out how much daylight a walk or a climb leaves you
- Knowing when it is properly dark for stargazing, which is astronomical twilight
- Setting a lighting or heating schedule that follows the season
- Checking how far north you have to go before the sun stops setting
How this generator works
The sun's declination and the equation of time come from the low-precision formulae of the Astronomical Almanac. Each event is the moment the sun's centre crosses a particular angle: minus 0.833 degrees for sunrise, which allows for refraction and the sun's own width, then six, twelve and eighteen degrees below for the three twilights, and six degrees above for the end of the golden hour. Two kinds of check follow. Internally, solar noon must fall exactly midway between sunrise and sunset and the twilights must nest in order around them. Externally, the page carries published almanac times for four places and dates and compares against them, because an internally consistent implementation of the wrong formula is still wrong.
Randomness and fairness
Nothing is random. The same place and date always give the same times.
For how randomness is produced across the whole site, see how Generate Random works.
Limitations and good to know
- Daylight saving is not applied automatically — set the offset to whatever is in force on the date.
- Height above sea level and local hills are not accounted for; a horizon obscured by a ridge comes later than this says.
- Refraction is taken as the standard allowance, and unusual air moves the real thing by a minute or two.
- The formulae are the low-precision set, good to about a minute across the present century rather than to the second.
Privacy and your data
The coordinates are used only for the arithmetic in your browser. No location is looked up, transmitted or stored.
Related generators
- Moon Phase CalculatorThe phase and illuminated fraction for any date, with the illumination recomputed from the age and the next new and full moons counted out.
- Daylight Hours CalculatorHow long the sun is up at any latitude on any day, with sunrise and sunset checked to be symmetric about solar noon.
- Event Countdown PlannerWorks backwards from the date to tell you when each job has to start, and says plainly when the plan does not fit.
- Planting Calendar GeneratorSowing, planting-out and harvest dates worked back from your own frost dates, with anything that will not ripen in time flagged.