Our sunrise-sunset calculator will help you estimate a location's sunrise and sunset time based on its latitude. As a bonus, you can also calculate the daylight hours of the area. These calculations require a good understanding of the Earth's rotation as it orbits around the Sun, starting with the fact that it is spherical (NOT FLAT!). Learn how to do these calculations yourself by going through the article below.

We also discussed another phenomenon related to Earth's rotation in the Coriolis effect calculator. Be sure to check it!

Sunrise and sunset

The sunrise is the first time the Sun appears over the horizon in the morning, marking the start of a new day. The sunset, on the other hand, marks the end of the day when the Sun disappears below the horizon in the evening.

Both sunrise and sunset times can vary significantly at different latitudes on Earth. This is because factors like the angle of the Earth's rotation relative to the Sun, the height of the Sun above the horizon, and local geography can all affect the timing and duration of these important events.

💡 Our Earth curvature calculator will prove a great read for our users inclined to understand the term horizon better.

One factor affecting sunrise and sunset times is the proximity to the equator. At latitudes closer to the equator, the Sun rises and sets at more constant points throughout the year since the Sun's path across the sky is more direct. In contrast, at latitudes further from the equator, there may be significant seasonal variations in the timing of sunrise and sunset as the Sun's path across the sky becomes more oblique during certain times of the year.

Calculating sunrise and sunset

The sunrise and sunset times are primarily dependent on two factors:

  • The latitude of the location; and
  • The day of the year.

Before calculating sunrise or sunset times, we introduce a new variable called the hour angle, given by:

ω=cos1(tanφtanδ)\omega = \mp \cos^{-1}\left(- \tan \varphi \tan \delta\right)


  • ω\omega - The hour angle, negative for sunrise and positive for sunset;
  • φ\varphi - The latitude of the location in degrees; and
  • δ\delta - The declination angle.

This declination angle δ\delta is the angle between the Equator and the line joining centers of Earth and the Sun, which varies every day. It is given by:

δ=23.45sin((284+n)360365)\delta = 23.45 \cdot\sin \left( \left(284 + n\right) \frac{360}{365}\right)

Where nn is the nthn^{th} day of the year. For instance, January 1ˢᵗ is the 1ˢᵗ day of the year, and December 31ˢᵗ is the 365ᵗʰ day of a non-leap year.

Our trigonometric functions calculator can help you find the values of sine, cosine, and tangent functions.

Declination angle of a location.
Declination angle of a location.

Using the sunrise hour angle, we can find out the sunrise time at a location:

sunrise time=12+ω15\rm{sunrise \text{ } time} = 12 + \frac{\omega}{15}

Remember that ω\omega is negative for sunrise!

Similarly, we can find out the sunset time at a location from its hour angle:

sunrise time=12+ω15\rm{sunrise \text{ } time} = 12 + \frac{\omega}{15}

Keep in mind that ω\omega is positive for sunset!

Calculating daylight hours

The daylight hours at a latitude is given by:

daylight hours=215cos1(tanφtanδ)daylight hours=215ω\small\begin{align*} \rm {daylight \text{ } hours} &= \frac{2}{15} \cdot \cos^{-1}\left(- \tan \varphi \tan \delta\right)\\[1em] \rm {daylight \text{ } hours} &=\frac{2}{15} \cdot \omega \end{align*}

Adjusting for atmospheric refraction

Our calculations thus far did not factor in atmospheric refraction, which makes the sun appear higher than its actual position. The following adjustment to the formula to calculate sunrise and sunset time will account for this phenomenon:

ω=±cos1(sinasinφcosδsinφcosδ)\omega = \pm \cos^{-1} \left(\frac{\sin a - \sin\varphi \cos \delta}{\sin\varphi \cos \delta}\right)

Where aa is the altitude angle, equal to 0.83°- 0.83\degree.

How to use this sunrise sunset calculator

Our calculator requires only two inputs from you:

  1. The day - click on the calendar 📅 icon in this sunrise-sunset calculator and select the date.
  2. The latitude of the location.

Based on this, the sunrise-sunset calculator will provide you with the following results adjusted for atmospheric refraction:

  • Sunrise/sunset angles.
  • Sunrise/sunset times.
  • Hours of daylight by latitude.

Clicking on the advanced mode button will give you these results without the adjustment for atmospheric refraction.

Krishna Nelaturu
Latitude (φ)
Day of the year
Declination angle (δ)
w/ Atmospheric refraction
Sunrise/Sunset angle (ω) ∓
Sunrise time
Sunset time
Daylight hours
People also viewed…

Black hole collision

Use our black hole collision calculator to learn what happens when a celestial object collides with a black hole.

Earth curvature

Calculate the curvature of Earth's effect on your horizon with our handy and scientific-based tool!

Schwarzschild radius

Discover the fundamental of black hole physics with our Schwarzschild radius calculator.
main background