Skip to content
CalculatorAtlas

Sunrise and Sunset Calculator

Tested

Approximate sunrise, sunset, solar noon and day length for a date and location.

Tested, not yet published. The formula for this calculator is implemented and passes its automated checks. This page stays non-indexable until it is reviewed and published.

Results

Enter your values and press Calculate. Results appear here.

  • • Result

Quick answer

Sunrise and sunset come from the sun's declination and the observer's latitude: cos H = (cos 90.833° − sin φ sin δ) ÷ (cos φ cos δ), then solar noon ∓ 4·H minutes. For New York on 20 March 2025 the result is sunrise 06:59, sunset 19:08 and 12 h 10 min of daylight.

Enter the date, latitude, longitude and UTC offset. The calculator returns sunrise, sunset, solar noon and day length.

Related tools: Heat Index Calculator: Apparent temperature from air temperature and relative humidity (°F). Cooling Degree Days Calculator: Cooling degree days from daily high and low temperatures. Heating Degree Days Calculator: Heating degree days from daily high and low temperatures.

How to use the Sunrise and Sunset Calculator

  1. Pick date.
  2. Enter latitude (°, north positive) (between -90 and 90).
  3. Enter longitude (°, east positive) (between -180 and 180).
  4. Enter uTC offset of your clock (hours) (between -12 and 14). It starts at 0.
  5. Press Calculate to see the result, and use Reset to start again.
Inputs of the Sunrise and Sunset Calculator
InputWhat to enterAllowed values
DateA calendar date—
Latitude (°, north positive)A number≥ -90, ≤ 90
Longitude (°, east positive)A number≥ -180, ≤ 180
UTC offset of your clock (hours)A number≥ -12, ≤ 14, starts at 0

Formula and method

Formula

cos H = (cos 90.833° − sin φ sin δ) ÷ (cos φ cos δ); sunrise/sunset = solar noon ∓ 4·H minutes; solar noon = 720 − 4λ − EoT

IEEE-754 double precision; shown to at most 6 decimal places.

Uses the NOAA solar-position equations (Meeus, Astronomical Algorithms) with the standard 90.833° zenith, which includes atmospheric refraction and the Sun's apparent radius. Times are for sea level and a flat horizon and are accurate to about a minute at mid-latitudes, less near the polar circles. Times are shown on a clock at the UTC offset you enter; daylight-saving rules are not applied.

Worked examples

These examples are verified: each one is an automated test case that the live calculator must reproduce exactly.

Example 1

Inputs: Date = 2025-03-20; Latitude (°, north positive) = 40.7128; Longitude (°, east positive) = -74.006; UTC offset of your clock (hours) = -4.

Results of example 1
ResultValue
Sunrise06:59
Sunset19:08
Solar noon13:04
Day length12 h 10 min

Example 2

Inputs: Date = 2025-06-21; Latitude (°, north positive) = 51.5074; Longitude (°, east positive) = -0.1278; UTC offset of your clock (hours) = 1.

Results of example 2
ResultValue
Sunrise04:43
Sunset21:22
Solar noon13:02
Day length16 h 38 min

Example 3

Inputs: Date = 2025-12-21; Latitude (°, north positive) = 34.0522; Longitude (°, east positive) = -118.2437; UTC offset of your clock (hours) = -8.

Results of example 3
ResultValue
Sunrise06:55
Sunset16:48
Solar noon11:51
Day length9 h 53 min

The first line is the headline result (sunrise). Below it the sunrise and Sunset Calculator lists sunset, solar noon and day length, which describe the same case from other angles. IEEE-754 double precision; shown to at most 6 decimal places.

Why 90.833°

Sunrise is defined when the sun's upper edge touches the horizon, after allowing 0.833° for atmospheric refraction and the sun's radius.

Accuracy

The approximation is usually within a few minutes at mid-latitudes. Local terrain, elevation and weather change what you see. Near the poles the sun may not rise or set, and the calculator reports it.

How the result changes with latitude

Holding every other input at the first worked example, this table changes only latitude. It shows how sensitive the answer is to that one value; each row was produced by running this calculator.

How the result changes with latitude
LatitudeSunriseSunsetSolar noon
20.3607:0019:0713:03
40.7106:5919:0813:04
81.4306:4019:3213:06

What happens with invalid input

These messages are produced by the calculator itself, so you know what to fix.

  • Date: left empty shows "Enter date." beside that field and no result.
  • Latitude (°, north positive): entering "91" shows "Latitude (°, north positive) must be at most 90." beside that field and no result.
  • Longitude (°, east positive): entering "200" shows "Longitude (°, east positive) must be at most 180." beside that field and no result.

Choosing between the Sunrise and Sunset Calculator and similar calculators

Each row shows what a related calculator on this site asks for and what it returns, so you can pick the one that matches your question.

Choosing between the Sunrise and Sunset Calculator and similar calculators
CalculatorYou enterIt returns
[Heat Index Calculator](/science/heat-index/)air temperature and relative humidityHeat index
[Cooling Degree Days Calculator](/science/cooling-degree-days-calculator/)base temperature, daily highs and daily lowsCooling degree days
[Heating Degree Days Calculator](/science/heating-degree-days-calculator/)base temperature, daily highs and daily lowsHeating degree days
[Dew Point Calculator](/science/dew-point/)air temperature and relative humidityDew point
[Acceleration Calculator](/science/acceleration-calculator/)initial velocity, final velocity and timeAcceleration

Assumptions and limitations

  • Polar day and polar night are reported instead of times
  • Elevation and local horizon are ignored
  • Daylight-saving time is not applied; enter the UTC offset in force on that date

If a required value is empty, not a number, or outside its allowed range, the form marks that field with a message and shows no result instead of a misleading number. The automated checks deliberately try invalid entries for date, latitude (°, north positive) and longitude (°, east positive) to confirm this.

Frequently asked questions

Why is day length 12 h 10 min on the equinox?

Refraction and the sun's width add minutes.

Do I enter west longitude as negative?

Yes. East longitudes are positive and west longitudes negative, for example −74.006 for New York.

Does it adjust for daylight saving?

Enter the local UTC offset.

What does the Sunrise and Sunset Calculator calculate?

Approximate sunrise, sunset, solar noon and day length for a date and location. It returns Sunrise, Sunset, Solar noon and Day length.

What formula does the Sunrise and Sunset Calculator use?

cos H = (cos 90.833° − sin φ sin δ) ÷ (cos φ cos δ); sunrise/sunset = solar noon ∓ 4·H minutes; solar noon = 720 − 4λ − EoT. Uses the NOAA solar-position equations (Meeus, Astronomical Algorithms) with the standard 90.833° zenith, which includes atmospheric refraction and the Sun's apparent radius.

What do I need to enter in the sunrise and Sunset Calculator?

You enter Date, Latitude (°, north positive), Longitude (°, east positive) and UTC offset of your clock (hours).

How is the result rounded or limited?

IEEE-754 double precision; shown to at most 6 decimal places. Polar day and polar night are reported instead of times.

What are the limits of this calculator?

Polar day and polar night are reported instead of times. Elevation and local horizon are ignored. Daylight-saving time is not applied; enter the UTC offset in force on that date.

What is an example of a sunrise and Sunset result?

With date 2025-03-20, latitude (°, north positive) 40.7128, longitude (°, east positive) -74.006 and uTC offset of your clock (hours) -4, the sunrise is 06:59.

Where does the method come from?

The method follows: NOAA Global Monitoring Laboratory, Solar Calculation Details (https://gml.noaa.gov/grad/solcalc/calcdetails.html; US government, public domain); Meeus, Astronomical Algorithms, 2nd ed. (1998), chapters 7, 22, 25 and 28; Verified against JPL DE421 positions computed with Skyfield for 20 locations and dates (largest difference 2 minutes).

Sources

  • NOAA Global Monitoring Laboratory, Solar Calculation Details (https://gml.noaa.gov/grad/solcalc/calcdetails.html; US government, public domain)
  • Meeus, Astronomical Algorithms, 2nd ed. (1998), chapters 7, 22, 25 and 28
  • Verified against JPL DE421 positions computed with Skyfield for 20 locations and dates (largest difference 2 minutes)

Content last reviewed 2026-11-04. Formulas and worked examples are checked by automated tests against independently computed values.