Sunrise and Sunset Calculator
Enter your latitude, longitude, date, and UTC offset to get exact sunrise and sunset times, solar noon, hours of daylight, and the start and end of all three twilight bands (civil, nautical, and astronomical). The math follows the NOAA solar position algorithm and results are typically accurate to within one minute for locations away from the polar zones.
How sunrise and sunset times are calculated
Sunrise and sunset times depend on three things: your geographic location (latitude and longitude), the date, and your time zone. The core of the calculation is the solar hour angle, which measures how far the sun has moved east or west of the local meridian. At sunrise the sun is at a zenith angle of 90.833 degrees (not exactly 90, because atmospheric refraction bends sunlight about 0.57 degrees and the sun's disc has a visible radius of roughly 0.26 degrees). The hour angle at which this occurs depends on the latitude and the solar declination - the angle of the sun north or south of the celestial equator, which changes throughout the year as Earth orbits the sun. Solar noon is not always exactly 12:00 on a clock because of the equation of time, a correction for the fact that Earth's orbit is slightly elliptical and its axis is tilted.
Civil, nautical, and astronomical twilight explained
Twilight is the period before sunrise and after sunset when the sky is not fully dark. There are three defined bands. Civil twilight occurs when the sun is between 0 and 6 degrees below the horizon. The sky is bright enough that artificial lighting is not needed for most outdoor tasks, and the horizon is clearly visible. Nautical twilight covers 6 to 12 degrees below the horizon. The sky is darker, but the horizon is still well defined at sea, making it the traditional period for taking star sights with a sextant. Astronomical twilight covers 12 to 18 degrees below the horizon. The sky is dark enough for most telescope work, though faint objects near the horizon can still be affected. When the sun drops below 18 degrees, the sky is considered fully dark - this is the start of true astronomical night.
Polar day and polar night
At high latitudes, the geometry of Earth's tilt can mean the sun never rises or never sets on a given date. When the solar declination is large enough in the same direction as the observer's hemisphere, the sun remains above the horizon for the entire 24-hour day - called midnight sun or polar day. The converse, polar night, happens when the sun stays below the horizon all day. The Arctic and Antarctic circles (approximately 66.5 degrees north and south) mark the minimum latitudes where at least one full day of midnight sun or polar night occurs each year. Near those circles the effect lasts only one day around each solstice; at the poles themselves it lasts roughly six months. This calculator returns a special message when your inputs produce a polar condition, since the sunrise and sunset times are undefined in that case.
The equation of time and why solar noon is not always at 12:00
A sundial and a clock can disagree by up to 16 minutes, even when daylight saving time is not involved. This difference is the equation of time, caused by two factors that combine throughout the year. First, Earth's orbit is an ellipse, not a perfect circle, so Earth moves faster near perihelion (early January) and slower near aphelion (early July), causing the sun to appear to slow down and speed up slightly across the year. Second, the tilt of Earth's axis means the sun's apparent east-west motion across the sky is not constant. The equation of time reaches its most extreme values in early November (about plus 16 minutes) and mid-February (about minus 14 minutes), and crosses zero four times per year. The solar noon shown by this calculator accounts for both effects, giving you the true moment the sun reaches its highest point for your location.
Twilight types and their solar elevation angles
| Twilight type | Sun elevation | Characteristics |
|---|---|---|
| Civil twilight | -6 deg | Bright enough for most outdoor activities; artificial lighting not needed |
| Nautical twilight | -12 deg | Horizon visible at sea; used for celestial navigation with a sextant |
| Astronomical twilight | -18 deg | Sky dark enough for most astronomical observations |
| Night (true dark) | Below -18 deg | Sky fully dark; ideal for faint object astronomy |
The sun position below the horizon defines which type of twilight is occurring.
Frequently asked questions
Why is sunset earlier or later than I expected?
The most common reason is that your selected UTC offset or daylight saving time setting does not match your actual local time. Double-check whether your region is currently observing daylight saving time. A second cause is longitude: within a wide time zone, locations to the east of the central meridian see earlier sunrises and sunsets on the clock, while western locations see later ones. Entering your exact longitude rather than using a city center estimate can shift the result by 10-20 minutes.
What is solar noon and why does it matter?
Solar noon is the moment when the sun crosses your local meridian and reaches its highest point in the sky. It is the midpoint between sunrise and sunset, but because the equation of time and your longitude within a time zone shift clock noon away from solar noon, they rarely coincide exactly. Solar noon is useful for setting up solar panels (aim them at the horizon position of the sun at solar noon for your latitude), for shadow navigation, and for photography - the sun's altitude at solar noon tells you the maximum elevation the sun will reach that day.
How accurate is this calculator?
For most locations away from the polar zones, results are accurate to within about one minute of the times published by the US Naval Observatory or NOAA. The algorithm uses the Spencer (1971) solar position equations with the standard atmospheric refraction correction of 0.57 degrees. Small errors arise because actual atmospheric refraction varies with temperature and pressure, and the equation of time used is an approximation to the full Kepler-based calculation. For professional survey or observatory use, consult the USNO Astronomical Applications Department directly.
What happens at the Arctic and Antarctic circles?
At latitudes above about 66.5 degrees north or south, the sun can remain above or below the horizon for a full 24-hour period around the solstices. This calculator detects those conditions and reports midnight sun or polar night instead of sunrise and sunset times. Between the polar circle and the pole, the period of midnight sun or polar night lengthens; at the poles themselves it lasts roughly six months.
Does this calculator account for daylight saving time?
Yes. Enable the daylight saving time toggle and the calculator adds one hour to the UTC offset you have selected, shifting all output times forward by one hour. You need to manage this manually because daylight saving transitions happen on different dates in different regions, and many regions do not observe it at all. If your results look one hour off, the most likely cause is that this toggle is not set correctly for your date and location.
What is the solar declination and what does it tell me?
Solar declination is the latitude on Earth where the sun is directly overhead at solar noon on a given date. It ranges from about +23.45 degrees at the June solstice (when the sun is overhead the Tropic of Cancer) to about -23.45 degrees at the December solstice (Tropic of Capricorn), crossing zero at both equinoxes. A positive declination means the sun is in the Northern Hemisphere of the sky, giving more daylight to northern latitudes. The declination drives both how long the day is and the maximum altitude the sun reaches above your horizon.
Why do the twilight times vary less than sunrise and sunset across seasons?
All twilight times shift together with sunrise and sunset, so they all vary significantly across seasons. However, at mid-latitudes in summer, the sun's path through the twilight zones (6, 12, and 18 degrees below the horizon) is at a shallow angle, which makes twilight periods much longer. At the equinox, the sun sets more steeply, so twilight is shorter. At very high latitudes in summer, astronomical twilight may not end at all before it begins again, meaning the sky never reaches full darkness.