TanodTools
EN

Sunrise, sunset, twilight and moon phase calculator

Enter a place and a date to get sunrise, sunset, solar noon, the three twilights, moonrise, moonset and the moon phase, in the time zone you choose.

Runs entirely in your browser

Accurate to about 1 minute for the Sun and 3 minutes for moonrise and moonset, with standard refraction and a flat horizon. Not for flight planning or navigation, or for legal times such as lighting-up or civil twilight limits: use the official almanac.

How to find sunrise and sunset times

  1. Enter the latitude and longitude of the place in decimal degrees (north and east are positive), or press the location button to use your device's position.
  2. Choose the date and the time zone to show the times in.
  3. Read the sun and moon times. Where the sun never rises or sets, the page says polar day or polar night.

How the times are calculated

The Sun's position uses the low-accuracy formulas of Jean Meeus, Astronomical Algorithms (2nd ed., Willmann-Bell, 1998), chapter 25, and the Moon's position uses the 33 largest longitude and distance terms and 14 largest latitude terms of chapter 47. Sidereal time follows chapter 12 and the lunar phase angle chapter 48. Altitude and azimuth come from the hour angle and declination, with a parallax correction for the Moon.

The page samples the altitude every ten minutes across the local day and bisects each crossing to a fraction of a second. Sunrise and sunset use a Sun-centre altitude of −0.833° (34′ refraction plus 16′ semi-diameter); the twilights use −6°, −12° and −18°; moonrise and moonset use the upper limb with the same refraction, allowing for the Moon's parallax and apparent size. Solar noon is the time of the Sun's highest altitude. The code is a port of the one behind our sun and moon API, which is tested against the JPL DE421 ephemeris.

Results assume a flat horizon at sea level and standard atmosphere; mountains, high ground and weather change the observed times by minutes. Not for navigation, flight planning or legal sunrise and sunset times.

Questions

How accurate are the times?

The algorithms are from Jean Meeus, Astronomical Algorithms. Compared with the JPL DE421 ephemeris, sunrise, sunset and twilight times agree to within about a minute and moonrise and moonset within about three. The real-world spread from air temperature, pressure and the local horizon is larger than that.

What are civil, nautical and astronomical twilight?

Twilight is the time when the Sun is below the horizon but still lights the sky. Civil twilight ends when the Sun is 6 degrees below the horizon (enough light for most outdoor activity), nautical twilight at 12 degrees (the horizon at sea is no longer visible) and astronomical twilight at 18 degrees (the sky is fully dark).

How is sunrise defined?

Sunrise and sunset are when the upper edge of the Sun appears at or disappears below a flat horizon, allowing for 34 arc-minutes of atmospheric refraction and the Sun's 16 arc-minute radius, so the centre of the Sun is 0.833 degrees below the horizon.

Why are there no sunrise or sunset times in some places?

Inside the polar circles around midsummer the Sun stays above the horizon all day (polar day or midnight sun), and around midwinter it stays below (polar night). Twilights can also be missing at high latitudes in summer.

What does the moon phase percentage mean?

It is the fraction of the Moon's visible disc that is lit as seen from Earth, from 0% at new moon to 100% at full moon. The phase name comes from the angle between the Moon and the Sun.

Does it use my location?

Only if you press the location button, and the position stays in your browser. The calculation runs on your device and nothing is sent anywhere. Some sites or browsers block the location prompt; then type your coordinates.