Home Date & Time Sunrise Sunset Calculator

Sunrise Sunset Calculator

Estimate sunrise and sunset times.

Input

Result

ADVERTISEMENT

What is a Sunrise Sunset Calculator?

A Sunrise Sunset Calculator estimates the precise times the sun rises and sets at any location on Earth on any given date. You enter the date and the latitude and longitude of your location, and the calculator returns the sunrise time, sunset time, and total day length. Photographers, gardeners, hikers, event planners, astronomers, and anyone planning outdoor activities use this tool to determine golden hour for photography, plan outdoor events around daylight, schedule gardening tasks, or simply know when it will get dark. The calculator uses standard solar position algorithms to account for the Earth's axial tilt, orbital position, and atmospheric refraction to give accurate times.

How to calculate sunrise and sunset manually (the formula)

Calculating sunrise and sunset manually involves complex spherical trigonometry. The basic approach uses the sun's declination angle and the observer's latitude. The hour angle (H) at sunset is given by: cos(H) = −tan(Latitude) × tan(SunDeclination). Sunrise time = 12:00 PM − H/15 (in hours), Sunset time = 12:00 PM + H/15 (in hours). The sun's declination varies from −23.44° to +23.44° throughout the year, reaching its maximum at the summer solstice and minimum at the winter solstice. Atmospheric refraction causes the sun to appear about 0.833° higher than its geometric position, which advances sunrise and delays sunset slightly. For most practical purposes, it is far easier to use an automated calculator that handles all these variables.

Example calculation

Let's find sunrise and sunset for New York City (latitude 40.71°N, longitude −74.01°W) on June 21, 2025 (the summer solstice). Enter the date June 21, 2025, latitude 40.7128, longitude −74.0060. The calculator shows: Sunrise approximately 5:25 AM EDT, Sunset approximately 8:30 PM EDT, Day length approximately 15 hours 5 minutes. On the summer solstice, the sun's declination is about +23.44°, which gives the maximum day length of the year. By contrast, on December 21, 2025 (the winter solstice), the same location would have sunrise around 7:15 AM and sunset around 4:30 PM, with a day length of only about 9 hours 15 minutes. The calculator shows how dramatically day length changes with latitude and season.

Common mistakes

  • Using the wrong sign for latitude or longitude — Northern latitudes are positive, southern are negative. Western longitudes are negative, eastern are positive. Mixing signs puts you in the wrong hemisphere.
  • Forgetting about atmospheric refraction — The sun appears on the horizon about 5 minutes earlier at sunrise and 5 minutes later at sunset than geometric calculations predict due to atmospheric bending of light.
  • Confusing sunset with civil twilight — Sunset is when the sun's upper edge touches the horizon. Civil twilight continues for about 20–30 minutes after sunset when there is still enough light for most outdoor activities.
  • Not accounting for elevation — Sunrise is earlier and sunset is later at higher elevations because the observer can see farther over the horizon. This calculator uses sea level as the default.
  • Using the wrong date format — The calculator uses the Gregorian calendar. Date format differences (MM/DD vs DD/MM) can lead to entering the wrong date.

Frequently asked questions

How do I calculate sunrise and sunset times for my location?

Enter the date, latitude, and longitude of your location. The calculator returns the sunrise time, sunset time, and day length for that date and location.

What latitude and longitude format should I use?

Use decimal degrees. For example, 40.7128 for New York City latitude and −74.0060 for its longitude. Northern latitudes are positive, southern are negative.

How accurate are the sunrise and sunset calculations?

The calculations use standard solar position algorithms and are accurate to within a few minutes for most locations, accounting for atmospheric refraction.

What factors affect sunrise and sunset times?

Latitude, longitude, time of year, and elevation all affect sunrise and sunset times. Higher latitudes experience more extreme variation between seasons.

What is day length?

Day length is the total time between sunrise and sunset. It varies throughout the year, being longest at the summer solstice and shortest at the winter solstice.

Why do sunrise and sunset times change throughout the year?

The Earth's axial tilt of 23.5 degrees causes the sun's apparent path to shift north and south over the year, changing when it rises and sets at any given location.