Calculating sunrise and sunset from latitude and longitude requires four specific inputs: a calendar date, the latitude and longitude of the observer, and the civil UTC offset that applies on that chosen date, because civil time zones are political and do not follow longitude lines. Once those four inputs are known, the calculation reduces to a sequence of compact solar-position equations derived from Jean Meeus's astronomical algorithms and documented by NOAA's Global Monitoring Laboratory: convert the date to a Julian time, derive the Sun's geometric longitude, mean anomaly, eccentricity correction, apparent longitude, corrected obliquity, solar declination, and equation of time, then find solar noon from longitude and the equation of time. Sunrise and sunset follow by adding and subtracting a sunrise hour angle that corresponds to an apparent zenith of 90.833 degrees, a convention that approximates atmospheric refraction and the Sun's visible disk near the horizon. The Sunrise Sunset Calculator performs that sequence in your browser, so no remote geocoding is required and coordinates are never uploaded.
The reason a plain coordinate pair is not enough on its own is that two locations with almost identical longitude can show their clocks reading very different times. Two nearby cities can sit in different time zones, and within a single country daylight saving rules can shift the offset several times a year. A latitude and longitude pair fixes where on Earth you are standing; the UTC offset fixes what your wall clock reads. The four-input structure is the same one used by the U.S. Naval Observatory's public rise and set services, and it is the safest way to keep the math reproducible across time-zone changes and historical dates.

Inputs and sign conventions for coordinates
Latitude and longitude follow a simple sign convention in this calculation. Latitude is positive for the northern hemisphere and negative for the southern hemisphere. Longitude is positive for the eastern hemisphere and negative for the western hemisphere. The tool accepts latitude from -89.8 to 89.8 degrees and longitude from -180 to 180 degrees, which covers every inhabited point on Earth while staying clear of the exact poles where the hour-angle equation becomes numerically singular.
| Convention | Positive | Negative | Example coordinates |
|---|---|---|---|
| Latitude | North of equator | South of equator | London 51.5, Sydney -33.9 |
| Longitude | East of prime meridian | West of prime meridian | New York -74.0, Sydney 151.2 |
| UTC offset | Ahead of UTC | Behind UTC | Tokyo +9, Los Angeles -8 |
Getting the sign right matters because the equation of time and the hour-angle geometry both depend on whether you are east or west of Greenwich. A user typing Sydney's longitude as -151.2 instead of +151.2 would place sunrise and sunset on the wrong side of midnight, because solar noon is derived from longitude. The offset also has to match the chosen date; on the same calendar day, Berlin might be +1 in winter and +2 during Central European Summer Time.
How to calculate sunrise and sunset with the Sunrise Sunset Calculator
- Open the Sunrise Sunset Calculator in your browser and pick a calendar date between the Gregorian years 1901 and 2099.
- Enter the latitude with north positive and the longitude with east positive. City-center coordinates from a reliable map are adequate for general planning.
- Enter the civil UTC offset that applies on that specific date, including any daylight saving time shift. Do not rely on the longitude to guess the offset.
- Read the resulting sunrise, solar noon, and sunset times in your local clock. Treat the minute values as apparent-horizon estimates rounded to the nearest minute.
- If a result is flagged as a polar day or polar night, interpret it as a state rather than a clock time, since the Sun does not cross the modeled horizon on that local date.
If you would like to compare the digital result against a traditional approach, the guide on how to calculate sunrise and sunset using an almanac walks through the same equations by hand with printed sight-reduction tables. For a maritime context where the horizon itself is tilted by the observer's height of eye, the article on how to calculate sunrise and sunset on a ship explains the dip-of-the-horizon adjustment on top of the standard calculation.
Understanding the output: solar noon, sunrise, sunset
Three clock values appear in the result: sunrise, solar noon, and sunset. Solar noon is the instant when the Sun is highest in the sky on the local meridian; it is derived from your longitude and the equation of time, and it is the value from which the other two are stepped. Sunrise equals solar noon minus the sunrise hour angle, and sunset equals solar noon plus the same angle, both converted from UTC minutes to local civil minutes and rounded to the nearest minute. The page preserves any day offset, so if an extreme combination of coordinates and offset pushes an event across midnight, a parenthetical previous- or next-day marker appears next to the time and is included in copied text.
The equation of time is the small correction that accounts for Earth's elliptical orbit and the tilt of its axis; it ranges between roughly minus fourteen and plus sixteen minutes across the year. If your coordinates give a solar noon that does not match local noon at your wall clock, the equation of time is usually the reason, not a bug in the calculation. The page also shows the solar declination as a diagnostic value so the result can be cross-checked against any reference implementation.
Why the UTC offset is entered manually
Civil time zones are political, not geographical. Two cities that share a longitude can sit in different time zones, and a single city can change its offset several times a year under daylight saving rules. The calculator deliberately does not infer a time-zone name from your coordinates and does not look up historical DST rules, because either action could silently pick the wrong offset on the chosen date. The page treats the offset as an explicit, single numeric input on the form.
By accepting the offset as an explicit input, the tool stays reproducible: a user in Boston on July 4 enters -4 for Eastern Daylight Time, while a user in Phoenix on the same date enters -7 for Mountain Standard Time because Arizona does not observe DST. If your coordinates and offset disagree with the location on that date, the result will shift; that is by design, so the calculation never has to guess.
The 90.833 degree zenith and the meaning of "apparent"
The sunrise hour angle is computed at a zenith of 90.833 degrees, not 90. The extra 0.833 degrees is the standard astronomical approximation for atmospheric refraction near the horizon plus the apparent radius of the Sun's disk. In other words, the calculator assumes you are standing at sea level on a flat, unobstructed horizon with average atmospheric conditions. Real weather, elevation, terrain, buildings, trees, and the observer's actual horizon can each move when the disk first appears or finally disappears.
NOAA states that the result is theoretically accurate to about a minute within about 72 degrees of latitude, with possible errors up to ten minutes beyond that range. That scope matches the assumptions built into the 90.833 degree zenith, which is why the page labels the minute values as apparent-horizon estimates rather than definitive observations. Independent golden tests compare six ordinary locations and seasons with U.S. Naval Observatory rise and set output, allowing a three-minute difference for model and rounding choices.
Polar day and polar night
At high latitudes the Sun can stay above or below the modeled apparent horizon for an entire local date. When the cosine of the sunrise hour angle exceeds 1, no geometric sunrise exists and the tool reports a polar night; when the cosine drops below -1, no geometric sunset exists and the tool reports a polar day. In both cases the page shows the state instead of inventing a clock time, and that state is itself a useful planning answer. The same rule is tested against Tromsø at the June and December solstices, where the independent reference reports the Sun continuously above or below the horizon.
This compact classification is exactly how NOAA and the U.S. Naval Observatory handle the high-latitude edge cases. The page reports the state transparently in the result panel, and the calculation that produced it is the same code path used everywhere else.
Method, limits, and when to consult a full ephemeris
The page follows the compact solar-position equations documented by NOAA's Global Monitoring Laboratory and derived from Jean Meeus's astronomical algorithms. It validates the Gregorian date, coordinates, and UTC offset, derives the solar terms at the date's Julian noon, computes the apparent sunrise hour angle at zenith 90.833 degrees, and converts the result to local civil minutes rounded to the nearest minute. Coordinates are accepted in the documented ranges, the date is limited to the Gregorian years 1901 through 2099 to match the intended accuracy scope, and the calculation runs locally so nothing is sent to a remote geocoding service.
For high-precision work, full ephemerides that include elevation, atmospheric pressure, temperature, and the precise event definition (civil, nautical, or astronomical twilight, official transit, and so on) are still the correct resource. A city-center coordinate is fine for broad planning but not for exact observations across a large region. If your use case involves navigation, religious rulings, legal determinations, telescope timing, or safety-critical operations, treat this calculator as a planning estimate and cross-check with an official source.
The underlying equations and conventions are described in detail at NOAA GML — Solar Calculation Details, which is the reference most compact rise and set tools follow.