Sunrise & Sunset Calculator

Work out sunrise, sunset, twilight and golden hour times for any date and any place on Earth.

Pick a city or type a latitude and longitude โ€” sunrise and sunset are calculated as you type.

Times are astronomical estimates for a flat horizon at sea level, accurate to about a minute. Mountains, buildings, altitude and unusual weather shift the moment you actually see the sun. Nothing here is medical advice โ€” if you are planning light therapy or a sleep schedule, treat these numbers as a guide and talk to a professional.

No uploads. Your files stay on your device.

Free forever, no sign-up, no cookies. Buy me a coffee

How it works

This calculator uses the NOAA solar position equations. From the calendar date it works out the Julian day, then the sun's declination and the equation of time for that moment. Combining those with your latitude gives the hour angle at which the sun's centre sits 0.833ยฐ below the horizon โ€” the standard sunrise and sunset definition, which already includes atmospheric refraction and the sun's apparent radius. Longitude converts that hour angle into a clock time, and the result is refined over a few iterations so it stays within about a minute of published almanac times.

The same maths, run at other solar altitudes, gives you civil dawn and dusk (sun 6ยฐ below the horizon โ€” the useful light before sunrise and after sunset) and the golden hours (sun below 6ยฐ above the horizon), which photographers use for warm, low-angle light. Near the poles the sun may never rise or never set, and the tool says so instead of inventing a time. Choose whether to show results in your device's timezone or a fixed UTC offset, switch between a 24-hour and a 12-hour clock, and copy or download the day โ€” plus a seven-day table โ€” as text or CSV. Everything is computed in your browser with plain JavaScript: no location lookup service, no API key, no ads, and your coordinates never leave the device.

Frequently asked questions

How accurate are the sunrise and sunset times?

They come from the NOAA solar position equations and land within about a minute of published almanac times. Sunrise and sunset are defined as the sun's centre sitting 0.833 degrees below the horizon, which already accounts for atmospheric refraction and the sun's apparent radius. The maths assumes a flat horizon at sea level, so hills, tall buildings or altitude will shift what you actually see by a few minutes.

What is the golden hour and when does it happen?

The golden hour is the period when the sun sits below roughly 6 degrees above the horizon, giving warm, soft, low-angle light that photographers prize. This calculator shows it twice: the morning golden hour runs from sunrise until the sun climbs past 6 degrees, and the evening golden hour runs from the moment it drops back below 6 degrees until sunset. Near the poles and in midsummer it can last for hours.

Why does it say midnight sun or polar night instead of a time?

Above the Arctic Circle and below the Antarctic Circle there are dates when the sun never sets or never rises, so no sunrise or sunset time exists. Rather than invent one, the tool reports midnight sun (day length 24h) or polar night (day length 0h) and still shows civil dawn and dusk when there is usable twilight.

Does the tool send my location anywhere?

No. Every calculation runs in your browser with plain JavaScript, and the city list and solar equations are built into the page. There is no geocoding service, no API key and no tracking of your coordinates. If you use the location button, the coordinates come from your browser and stay on your device.

Report a bug