Sunrise & Sunset Calculator

Pick a date and a latitude/longitude. Returns sunrise, sunset, and day length.

Sunrise
2026-04-29 04:36 UTC
Sunset
2026-04-29 19:20 UTC
Day length
14h 44m

Enter a date and a latitude/longitude pair and the calculator returns the sunrise, sunset, and day length for that location, computed locally in your browser via the open-source astronomy-engine library — no API call, no tracking, no rate limit. The result is the geometric solar position corrected for atmospheric refraction at the standard pressure assumption, which matches the times most almanacs publish to the nearest minute. The calculator is paired with the moon phases calendar for the same night and the equinoxes & solstices page that bound day-length extremes; for cross-city scheduling at the resulting wall-clock times, see the world clock.

Common use cases

  • Planning a sunset photography session. Enter the venue coordinates and the shoot date to see when golden hour starts. Sunset is when the upper limb of the sun touches the horizon; useful golden-hour light typically begins about 60 minutes earlier and ends 20 minutes after. Cross-check with the moon phases page if you want to combine sunset and moonrise in one shot.
  • Astronomy session prep. Telescope sessions need the sky to be properly dark, which is roughly 60–90 minutes after sunset (end of astronomical twilight). Use this calculator to find sunset for your location, then add an hour to get a usable observing-start time. Combine with the meteor showers page to plan around peak nights.
  • Ramadan / fasting times. Religious fasts that begin at imsak (slightly before sunrise) and end at maghrib (sunset) need accurate astronomical sunrise and sunset for the observer's coordinates each day of the month. The calculator returns geometric sunrise/sunset; specific traditions add or subtract a few minutes for safety margin and for the imsak/iftar conventions.
  • Travel: golden hour overseas. Heading to an unfamiliar city? Enter the destination's lat/lng and the dates of your trip to know when the light is best for outdoor sightseeing. The calculator works for any populated location worldwide; pair it with the world clock to convert the UTC results to the local time you'll actually wear on your wrist.

How it works

The calculator passes your coordinates and date to astronomy-engine's SearchRiseSet routine, which iteratively solves for the moment when the sun's upper limb crosses the horizon (geometric altitude of -0.833°, accounting for atmospheric refraction and the sun's angular radius). The search starts at the requested UTC midnight and looks forward up to 24 hours; the first crossing is sunrise, the next the same direction is the next day's sunrise. Day length is computed as the simple difference between sunset and sunrise. All times are returned in UTC; convert to your local zone using the world clock.

Worked examples

London midsummer 2026

Enter latitude 51.5074, longitude -0.1278, date 2026-06-21.

Result: Sunrise 03:43 UTC (04:43 BST), sunset 20:21 UTC (21:21 BST), day length 16h 38m.

The summer solstice is the longest day in the Northern Hemisphere. London sees just over 16.5 hours of daylight; the equivalent winter date (December 21) gives only about 7h 50m. UTC times convert to BST in summer (+1) and GMT in winter.

Quito on the September equinox 2026

Enter latitude -0.18, longitude -78.47, date 2026-09-23.

Result: Day length close to 12h 06m.

Equatorial cities like Quito see ~12 hours of daylight every day, year-round; the small variation comes from atmospheric refraction adding a few minutes either side. The exact equinox is not the day with 12-hour days — that day (the equilux) is shifted by 2-4 days from the equinox depending on latitude.

Svalbard polar night

Enter latitude 78, longitude 15, date 2026-12-21.

Result: Sunrise and sunset both blank — the sun does not rise on this day.

Above the Arctic Circle (66.5°N) the sun stays below the horizon around the December solstice. Polar night lasts roughly mid-November to late January at 78°N. The equivalent polar day around June 21 has the sun never setting; the calculator returns blank for both fields rather than fabricating a value.

Edge cases & gotchas

  • Polar night and polar day return null. Within the Arctic and Antarctic Circles, there are days when the sun never crosses the horizon (winter polar night) and days when it never sets (summer polar day). The calculator returns null sunrise and null sunset for these days rather than fabricating a value. If you need the moment of solar noon (the highest altitude the sun reaches that day), use the moon-phases page's sun position panel as a workaround.
  • High-altitude observers see earlier sunrise. The calculator assumes sea level (elevation 0). At higher altitude the geometric horizon is slightly depressed, so sunrise is a few minutes earlier and sunset a few minutes later than this calculator reports. The error is usually under 5 minutes even at 3,000 m; for precision astronomy work, use astronomy-engine directly with your true elevation.
  • Atmospheric refraction is approximated. Refraction at the horizon depends on local pressure and temperature; the calculator uses the standard ICAO atmosphere (1013.25 hPa, 15°C). On an unusually cold or high-pressure day, real sunrise can be a minute or two different from the calculator's value. Mirage effects near the horizon (looming, towering) can shift apparent sunrise by even more, but these are not modelled.
  • Date input is interpreted as UTC. The date you enter is treated as UTC midnight, then the search looks forward for the first sunrise after that moment. For locations west of UTC, this is the same calendar day in local time. For far-eastern zones (UTC+12 to UTC+14), the "calendar day" you have in mind may correspond to a different UTC date — enter the UTC date your evening rolls into, not necessarily the local one.

Frequently asked questions about Sunrise & Sunset Calculator

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

UTC keeps the calculator location-agnostic — the same coordinates produce the same answer regardless of where the request comes from, which is what astronomers and almanacs do. To convert to your local clock, look up the destination's offset on the world clock and add or subtract; e.g. for London in summer, add 1 hour for BST.

What's the difference between civil, nautical, and astronomical twilight?

Civil twilight ends when the sun is 6° below the horizon; you can still read outdoors. Nautical twilight ends at 12° below — the horizon is no longer visible at sea. Astronomical twilight ends at 18° below — the sky is fully dark. This calculator returns sunrise/sunset (sun at 0° below, accounting for refraction); add roughly 30 minutes per twilight category for the same latitude.

How accurate are the times?

astronomy-engine is good to within seconds for the sun's position and angular size. The dominant error source is atmospheric refraction — the standard atmosphere assumption introduces a possible 1-2 minute error on either side. For most practical purposes the result is correct to the nearest minute, which matches the precision published by the US Naval Observatory and equivalent national almanacs.

Why do my results disagree with weather.com or my phone weather app?

Most weather apps use the same atmosphere assumptions but may apply additional adjustments (e.g. for the local terrain horizon or for "official" sunrise defined by jurisdiction). Differences of 1-2 minutes are normal. If the difference is larger than 5 minutes, double-check that you entered coordinates rather than a city name in the wrong country.

Does the calculator handle daylight saving time?

No — DST is a wall-clock convention that doesn't affect the sun's actual position. The calculator returns UTC times. You apply DST yourself when converting to local clock time: for a DST-observing zone, add 1 hour to the standard offset during the DST window.

What about the equation of time and solar noon?

The calculator focuses on rise and set, not solar noon. Solar noon (when the sun is due south at most latitudes) lags or leads clock noon by up to ±16 minutes over the year — this is the equation of time. To find solar noon for a date, average sunrise and sunset times: (sunrise + sunset) / 2 gives solar noon UTC to within a fraction of a minute.

Glossary

Sunrise
The instant when the upper limb of the sun first appears above the horizon at sea level, accounting for atmospheric refraction (-0.833° geometric altitude). Defined by international convention so almanacs from different countries agree.
Sunset
The instant when the upper limb of the sun disappears below the horizon at sea level, also corrected for refraction. Symmetric with sunrise across solar noon for any given latitude.
Day length
The time elapsed between sunrise and sunset on a given day. Varies with latitude and date; minimum at the winter solstice, maximum at the summer solstice. Equatorial sites stay near 12 hours year-round.
Atmospheric refraction
The bending of light by Earth's atmosphere, which makes the sun appear about 0.566° (one solar diameter) higher than its true geometric position when near the horizon. Causes sunrise to occur a few minutes before geometric sunrise.
Polar night
The period when the sun stays below the horizon for the full 24 hours, occurring within the Arctic Circle (above ~66.5°N) in northern winter and within the Antarctic Circle in southern winter. Length increases with latitude.
Equation of time
The difference between solar noon (sun crossing the meridian) and clock noon at a fixed time zone. Varies by ±16 minutes over the year; explains why earliest sunset is in early December at mid-northern latitudes, not on the December solstice.

Related Time Tools