ToolNimba Browse

🌅 Sunrise and Sunset Calculator

By ToolNimba Editorial Team · Updated 2026-06-19

Sunrise
-
Sunset
-
Daylight length
-

Enter a latitude, longitude, date and UTC offset to estimate the sunrise and sunset times.

Times are approximate and use the standard sunrise equation with a zenith of 90.833 degrees (allowing for atmospheric refraction and the radius of the Sun). Do not rely on them for aviation, marine or other safety-critical use.

This sunrise and sunset calculator estimates when the Sun rises and sets at any point on Earth. Enter the latitude, longitude, the date and your UTC offset, and it returns the approximate sunrise time, sunset time and the total length of daylight. It runs entirely in your browser using the standard sunrise equation, so nothing is sent anywhere. The figures are an approximation, not survey-grade times, but for most everyday planning they land within a couple of minutes of published almanac values.

What is the Sunrise Sunset Calculator?

Sunrise and sunset are defined as the moments when the upper edge of the Sun appears to touch the horizon. They depend on three things: where you are (latitude and longitude), the date (which fixes how far north or south the Sun sits in the sky), and the time zone you want the answer in. The Sun does not rise at the same clock time everywhere, even within one time zone, because your longitude shifts solar noon earlier or later than the zone's central meridian.

The calculator uses the sunrise equation, the same approach published by NOAA. From the date it works out the number of days since the year 2000 epoch, then the Sun's mean anomaly, the equation of the centre, and the ecliptic longitude. Those give the solar declination, which is how far north (positive) or south (negative) of the equator the Sun is on that day. The declination swings between about +23.44 degrees at the June solstice and -23.44 degrees at the December solstice, and it is what drives the long days of summer and short days of winter.

The last step is the hour angle: how far the Earth must rotate between solar noon and the moment the Sun reaches the horizon. The calculation uses a zenith of 90.833 degrees rather than a flat 90 degrees. That extra 0.833 degree allows for atmospheric refraction (which lifts the Sun's image by roughly half a degree near the horizon) and for the radius of the Sun's disc (about a quarter of a degree), since sunrise is the first sliver of the disc, not its centre. Sunrise and sunset are then placed symmetrically before and after solar noon, and converted to your chosen UTC offset.

When to use it

  • Planning photography during the golden hour just after sunrise or before sunset.
  • Scheduling outdoor work, hikes, runs or events around available daylight.
  • Checking how much daylight you gain or lose week to week through the seasons.
  • Comparing day length between two cities or two dates for travel and planning.
  • Estimating lighting or solar exposure for gardens, panels and buildings.

How to use the Sunrise Sunset Calculator

  1. Enter your latitude in degrees (north is positive, south is negative).
  2. Enter your longitude in degrees (east is positive, west is negative).
  3. Pick the date you want, or click Set date to today.
  4. Enter the UTC offset for the time zone you want the answer in (for example -5 for US Eastern Standard Time).
  5. Read off the estimated sunrise, sunset and total daylight length. You can also click Use my location to fill latitude and longitude automatically.

Formula & method

Solar declination delta comes from the ecliptic longitude lambda: sin(delta) = sin(lambda) × sin(23.44 degrees). The hour angle H is cos(H) = (sin(-0.833 degrees) - sin(latitude) × sin(delta)) ÷ (cos(latitude) × cos(delta)). Sunrise = solar noon - H, sunset = solar noon + H, and daylight length = 2H ÷ 15 hours (since the Earth turns 15 degrees per hour).

Worked examples

New York City (latitude 40.7128, longitude -74.0060) on 21 June 2026, asking for times in UTC-4 (Eastern Daylight Time).

  1. For this date the solar declination is about +23.44 degrees (close to the June solstice maximum).
  2. cos(H) = (sin(-0.833) - sin(40.7128) × sin(23.44)) ÷ (cos(40.7128) × cos(23.44))
  3. This gives an hour angle H of about 113.20 degrees.
  4. Daylight length = 2 × 113.20 ÷ 15 = 15.09 hours, that is 15h 06m.
  5. Placing sunrise and sunset symmetrically around solar noon (about 12:58 local) and converting to UTC-4 gives sunrise 05:25 and sunset 20:31.

Result: Sunrise about 05:25, sunset about 20:31, daylight about 15h 06m.

A point on the equator (latitude 0, longitude 0) on 20 March 2026, near the spring equinox, in UTC+0.

  1. Near the equinox the solar declination is almost zero (about -0.22 degrees).
  2. cos(H) = (sin(-0.833) - sin(0) × sin(-0.22)) ÷ (cos(0) × cos(-0.22))
  3. With latitude 0, the sin(latitude) term vanishes, so cos(H) = sin(-0.833) ÷ cos(-0.22).
  4. The hour angle H is about 90.83 degrees, giving daylight = 2 × 90.83 ÷ 15 = 12.11 hours, about 12h 07m.
  5. The day is just over 12 hours because the -0.833 degree zenith and refraction stretch it slightly beyond a perfect 12 hours.

Result: Sunrise about 06:04, sunset about 18:11, daylight about 12h 07m.

Approximate solar declination through the year (drives day length)

DateEventSolar declination
Around Mar 20Spring equinoxAbout 0 degrees
Around Jun 21June solsticeAbout +23.44 degrees
Around Sep 23Autumn equinoxAbout 0 degrees
Around Dec 21December solsticeAbout -23.44 degrees

How day length changes with latitude on the June solstice (Northern Hemisphere)

LatitudeApproximate daylight
0 degrees (equator)About 12h 07m
23.4 degrees (tropic)About 13h 25m
40 degreesAbout 15h 00m
51 degrees (London)About 16h 38m
66.5 degrees (Arctic Circle)About 24h (midnight sun)

Common mistakes to avoid

  • Getting the sign of longitude or the UTC offset wrong. West longitudes and most American time zones are negative. New York is longitude -74 and UTC-5 in winter, UTC-4 in summer. Entering a positive value, or forgetting daylight saving, will shift the clock times by hours.
  • Forgetting daylight saving time. The calculator works in a fixed UTC offset. If your region observes daylight saving, use the offset that is actually in force on that date (for example UTC-4 instead of UTC-5 for US Eastern Time in summer), or the times will be off by an hour.
  • Expecting exactly 12 hours of daylight at the equinox. Because sunrise is measured at the first sliver of the disc and refraction lifts the Sun, the equinox day is a little over 12 hours, not exactly 12. This is normal and built into the standard equation.
  • Treating the result as exact to the second. This is a simplified model. It ignores your altitude, local terrain and hills, and unusual refraction, so it can differ from precise almanac times by a minute or two, more near the poles.

Glossary

Sunrise
The moment the upper edge of the Sun first appears above the horizon in the morning.
Sunset
The moment the upper edge of the Sun disappears below the horizon in the evening.
Solar declination
The angle of the Sun north or south of the celestial equator on a given day, ranging from about +23.44 to -23.44 degrees over the year.
Hour angle
How far (in degrees) the Earth must turn between solar noon and the Sun reaching the horizon. The Earth turns 15 degrees per hour.
Solar noon
The moment the Sun is highest in the sky and crosses the local meridian, midway between sunrise and sunset.
Zenith angle
The angle from straight overhead to the Sun. A zenith of 90.833 degrees is used for sunrise to allow for refraction and the size of the Sun.
Atmospheric refraction
Bending of light by the atmosphere that lifts the apparent position of the Sun near the horizon by about half a degree.

Frequently asked questions

How accurate is this sunrise and sunset calculator?

It uses the standard NOAA sunrise equation and is typically accurate to within one to two minutes for low and mid latitudes. Accuracy drops near the poles and at high altitude, because the model ignores elevation, local terrain and unusual atmospheric refraction. Treat the times as a close estimate, not survey-grade data.

What latitude and longitude should I enter?

Use decimal degrees for your location. Latitude is positive north of the equator and negative south of it; longitude is positive east of Greenwich and negative west of it. For example New York is about latitude 40.71 and longitude -74.01. You can also click Use my location to fill these in from your device.

Why are the times in UTC offset rather than my local time zone name?

Time zone names hide a lot of complexity (daylight saving, historical changes, half-hour zones). Asking for a plain UTC offset keeps the maths unambiguous. Enter the offset that applies on your chosen date, for example -4 for US Eastern Daylight Time or +5.5 for India.

Why is the day not exactly 12 hours at the equinox?

Sunrise is timed to the first sliver of the Sun, not its centre, and the atmosphere refracts (bends) sunlight so the Sun appears higher than it really is. Both effects add a few minutes, so the equinox day works out to a little over 12 hours rather than exactly 12.

What does it mean when it says polar night or midnight sun?

At high latitudes near the solstices the Sun can stay below the horizon for the whole day (polar night) or above it for the whole day (midnight sun). When the geometry produces one of these cases the calculator reports None for sunrise and sunset and shows 0 or 24 hours of daylight.

Does this work for any year and any location on Earth?

Yes. The equation is valid for any date and any latitude and longitude, including the Southern Hemisphere and the polar regions. Far from the equator and close to the solstices the simplified model is less precise, but for normal towns and cities it gives reliable everyday results.