Sunrise and Sunset Calculator

Find the approximate time of sunrise and sunset, plus the day length, for any date and latitude — including handling of the midnight sun and polar night.

Day length
Sunrise (UTC)
Sunset (UTC)
Embed on your website →

How to use the calculator

  1. Pick a shortcut city or enter your own latitude and longitude.
  2. Pick the date you want to calculate for.
  3. See sunrise, sunset (in UTC), and total day length.

How it's calculated

Based on NOAA/Meeus's public solar position formula

The calculation uses Earth's axial tilt and position in its orbit for the selected date, combined with latitude, to find when the sun crosses the horizon. Times are shown in UTC (universal time) — add or subtract your timezone and any daylight saving to get local time.

Limitations: Accuracy is typically within ±1-2 minutes, depending on latitude and atmospheric refraction, which isn't fully modeled. Near the polar circles, sunrise/sunset can be entirely absent (midnight sun in summer, polar night in winter) — this is shown clearly in the result.

Why the sun rises before it actually does

Sunrise is defined as the moment the solar disc begins to break the horizon — but light from the sun is bent by the atmosphere before it reaches you. This refraction lifts the sun's apparent position by roughly half a degree, which is nearly the full width of the solar disc. In practice that means you see the sun rise several minutes before it is geometrically above the horizon, and you still see it several minutes after it has set.

The effect grows the further from the equator you are, because the sun then approaches the horizon on a shallower path and takes longer to cross it. That is part of the explanation for the long twilights at high latitudes, and for why the midnight sun lasts a few days longer than a purely geometric calculation would suggest. Calculated times also assume a clear horizon — hills to the east or west shift the real moment considerably.

Frequently asked questions

Why are the times shown in UTC and not local time?

Because local timezone and daylight saving vary by location and date. UTC is an unambiguous reference — add your local UTC offset to get local time.

What do "midnight sun" and "polar night" mean?

Near the poles, in summer the sun can stay above the horizon all day (midnight sun), or in winter never rise above it at all (polar night). The calculator shows this as a distinct status instead of a time.

Why are there two latitude fields — shortcut and custom?

The shortcut automatically fills in latitude and longitude for a few common cities. Choose "Custom latitude" to enter any location yourself.

Embed this calculator on your website

Copy the code below to show this calculator directly on your blog or website — completely free.