Roboculator
Online CalculatorsCategoriesDate & EventsNews
Get Started
Online CalculatorsCategoriesDate & EventsNewsGet Started
Roboculator

Smart calculators for every challenge. Free, fast, and private.

Categories

  • Finance
  • Health
  • Math
  • Construction
  • Conversion
  • Everyday Life

Popular Tools

  • Date & Events
  • Loan Calculator
  • BMI Calculator
  • Percentage Calc
  • Latest News
  • Search All

Resources

  • Glossary
  • Topic Tags
  • News & Insights

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Service
  • Editorial Policy
  • Disclaimer
© 2026 Roboculator. All rights reserved.
Roboculator

roboculator.com

  1. Home
  2. /Astronomy
  3. /Observational Astronomy Calculators
  4. /Sunrise/Sunset Calculator

Sunrise/Sunset Calculator

Calculator

Results

Enter values to see results

Sunrise (decimal hours UTC+offset)

—

hr

Sunset (decimal hours UTC+offset)

—

hr

Day Length

—

hr

Solar Noon

—

hr

Results

Enter values to see results

Sunrise (decimal hours UTC+offset)

—

hr

Sunset (decimal hours UTC+offset)

—

hr

Day Length

—

hr

Solar Noon

—

hr

The Sunrise/Sunset Calculator computes the times of sunrise and sunset, solar noon, and day length for any location on Earth on any day of the year. These calculations use the NOAA solar position algorithm based on the Spencer (1971) and Iqbal (1983) methods for computing solar declination and the equation of time — accurate to within a few minutes for most latitudes and dates.

The times of sunrise and sunset depend on three factors: the observer's latitude, the observer's longitude, and the solar declination (how far north or south the Sun is relative to the celestial equator). The Sun's declination varies throughout the year as Earth orbits the Sun on its tilted axis — from +23.5 degrees at the June solstice (when days are longest in the Northern Hemisphere) to -23.5 degrees at the December solstice.

At the equinoxes (roughly March 20 and September 22-23), the Sun's declination is 0 degrees, and day and night are approximately equal in length at all latitudes. At the solstices, the difference in day length with latitude is maximized. Above the Arctic Circle (66.5 degrees N) at the summer solstice, the Sun does not set — the phenomenon of midnight sun. Below the Antarctic Circle (66.5 degrees S) in the same season, there is polar night.

The equation of time accounts for the non-uniform speed of the Sun across the sky due to Earth's elliptical orbit (moving faster at perihelion in January) and the tilt of Earth's axis. It causes solar noon to vary by up to about 16 minutes from 12:00:00 clock time even for an observer at the center of their time zone.

Visual Analysis

How It Works

Solar declination (Spencer 1971): delta = 0.006918 - 0.399912 cos(gamma) + 0.070257 sin(gamma) - 0.006758 cos(2gamma) + 0.000907 sin(2gamma), where gamma = 2pi(DOY-1)/365 radians. Equation of time (EqT in minutes). Hour angle at sunrise: cos(H0) = (cos(90.833 deg) - sin(lat) sin(delta)) / (cos(lat) cos(delta)), where 90.833 deg accounts for atmospheric refraction and Sun's angular size. Solar noon UTC = 12 - EqT/60 - longitude/15. Sunrise/sunset = solar noon +/- H0/15 hours + UTC offset.

Understanding Your Results

Day length output in decimal hours: 12 hours at equinoxes at all latitudes. Maximum at summer solstice increases with latitude. Above latitude 66.5 degrees, cos(H0) may go below -1 (midnight sun) or above +1 (polar night) — the calculator clamps these to prevent math errors. The output times are in local time per the specified UTC offset.

Worked Examples

New York City, Summer Solstice

Inputs

latitude40.7128
longitude-74.006
day of year172
timezone offset-4

Results

sunrise hr5.442
sunset hr20.523
day length hr15.08
solar noon hr12.98

On the summer solstice (day 172), New York City (EDT, UTC-4) sees about 15.1 hours of daylight — sunrise around 5:26 AM and sunset around 8:31 PM local time.

London, Winter Solstice

Inputs

latitude51.5074
longitude-0.1278
day of year355
timezone offset0

Results

sunrise hr8.048
sunset hr15.98
day length hr7.93
solar noon hr12.01

On the winter solstice, London sees less than 8 hours of daylight — sunrise around 8:03 AM and sunset around 3:59 PM GMT.

Frequently Asked Questions

Solar noon (when the Sun is highest in the sky) differs from clock noon for two reasons: (1) Your longitude within your time zone shifts clock noon from solar noon by up to 30 minutes. (2) The equation of time, which varies from -16 to +14 minutes throughout the year, accounts for Earth's elliptical orbit and axial tilt affecting the Sun's apparent speed along the ecliptic.

Earth's axis is tilted 23.5 degrees relative to its orbital plane. As Earth orbits the Sun, this tilt causes the Sun to appear higher in the sky (and visible for longer) in summer and lower (visible for less time) in winter. At the equator, day length is always close to 12 hours. At higher latitudes, the seasonal variation becomes more extreme — up to continuous daylight or darkness at the poles.

These are three levels of twilight defined by how far below the horizon the Sun is. Civil twilight: Sun 0-6 degrees below horizon (bright enough for outdoor activities without artificial light). Nautical twilight: Sun 6-12 degrees below (bright enough to see the horizon at sea). Astronomical twilight: Sun 12-18 degrees below (dark enough for most astronomical observations). True night begins when the Sun is more than 18 degrees below the horizon.

The midnight sun is the phenomenon where the Sun does not set for a full 24-hour period. It occurs above the Arctic Circle (66.5 degrees N) around the summer solstice and above the Antarctic Circle (66.5 degrees S) around the winter solstice. The number of days with midnight sun increases with latitude, reaching 6 months of continuous daylight at the poles.

The equinoxes give close to 12 hours of daylight but not exactly. This is because: (1) The calculator counts sunrise/sunset when the top edge of the Sun is at the horizon (correcting for the Sun's angular radius of 0.27 degrees). (2) Atmospheric refraction bends sunlight by about 0.57 degrees at the horizon, allowing the Sun to be seen briefly before it actually rises geometrically. These two effects combined add about 10-14 minutes of extra daylight near the equinoxes.

The analemma is the figure-8 pattern traced by the Sun's position in the sky at the same clock time each day throughout the year. It reflects the combination of the equation of time (horizontal variation) and the changing solar declination (vertical variation). If you photograph the Sun at exactly noon every day for a year, the images form an analemma shape in the sky.

Higher altitudes allow you to see the Sun earlier at sunrise (the geometric horizon is farther below the mathematical horizon) and later at sunset. This effect is significant for mountains: at the summit of Everest (8,849 m), sunrise occurs about 15 minutes earlier than at sea level at the same latitude due to the visible horizon being about 335 km away. This calculator does not account for altitude.

Due to the equation of time, the earliest sunrise, the latest sunset, and the longest day (summer solstice) do not all coincide. In the Northern Hemisphere, the earliest sunrise typically occurs about a week before the summer solstice, and the latest sunset about a week after. Similarly, the shortest day is December 21-22, but the earliest sunset is around December 7 and the latest sunrise is around January 4-5.

No — this calculator is specific to Earth and uses Earth's axial tilt (23.5 degrees) and orbital parameters. Other planets have different axial tilts (Mars 25.2 degrees, Uranus 97.8 degrees) and different orbital periods, which would produce very different sunrise/sunset patterns. Mars has longer days (24h 37m) and an 18-month year with its own seasonal structure.

The equation of time is the difference between solar time (measured by the Sun's actual position) and mean solar time (uniform clock time). It has two components: Earth's orbital eccentricity (moves faster near perihelion in January, making solar noon earlier) and axial tilt (Sun moves along the ecliptic rather than the equator, creating seasonal variation in solar day length). The total variation ranges from about -16 minutes in early November to +14 minutes in mid-February.

Sources & Methodology

Spencer, J.W. (1971) — Fourier series representation of the position of the sun. Search 2:172. NOAA Solar Position Calculator. Iqbal, M. (1983) — An Introduction to Solar Radiation.
R

Roboculator Team

The Roboculator Team explains calculations, planning tools, and practical formulas in clear language for real-life situations.

How helpful was this calculator?

Be the first to rate!

Related Calculators

Moon Phase Calculator

Observational Astronomy Calculators

Horizon Distance Calculator

Observational Astronomy Calculators

Constellation Visibility Calculator

Observational Astronomy Calculators

Right Ascension to Hour Angle Converter

Observational Astronomy Calculators

Declination to Altitude Converter

Observational Astronomy Calculators

J2000 to Current Precession Calculator

Observational Astronomy Calculators