This sunrise and sunset calculator estimates the times the Sun’s upper edge crosses an ideal (flat) horizon for a given latitude, longitude, and date. It uses common astronomical approximations (similar in spirit to public NOAA-style methods) and applies a standard correction for atmospheric refraction and the Sun’s apparent radius.
What you’ll get: estimated sunrise time, estimated sunset time, and (optionally, depending on implementation) related values such as daylight length and solar noon. Results are typically displayed in your device/browser time zone unless the calculator offers a time zone selector.
“Sunrise” and “sunset” are not computed for the Sun’s center exactly at the geometric horizon. Most almanacs define them when the Sun’s upper limb touches the horizon. To approximate this, calculations commonly use a target solar elevation of:
a = −0.833°
This value bundles typical atmospheric refraction near the horizon (~34 arcminutes) and the Sun’s apparent semi-diameter (~16 arcminutes). Real conditions can shift observed times by minutes.
At a high level, sunrise and sunset come from solving when the Sun reaches the chosen elevation angle a at your latitude on the given date. A standard approach uses the Sun’s declination (δ) and the local hour angle (H).
The declination δ is the Sun’s angular position north/south of Earth’s equatorial plane. It changes slowly day to day as Earth orbits the Sun. There are several approximations; many calculators compute δ from the day-of-year or from a Julian-date-based solar model.
For a given latitude φ, declination δ, and target elevation a, the sunrise/sunset hour angle satisfies:
Once you compute H (in degrees), you can convert it to time because Earth rotates ~15° per hour. Conceptually:
Practical calculators also account for the “equation of time” (the difference between mean time and apparent solar time) and longitude offset from the time zone’s standard meridian.
If your results differ from an “official” local source by a few minutes, that can be normal due to differences in refraction assumptions, elevation, horizon obstructions, rounding, and the solar model used.
Example: New York City (approx. 40.71° latitude, −74.01° longitude) on 2024-06-21.
You should see sunrise around the early morning and sunset in the evening (roughly matching the long daylight near the June solstice in the northern hemisphere). Exact minutes can vary by method and time-zone/DST handling.
| Feature | This calculator | Professional astronomy software | Simple location lookup |
|---|---|---|---|
| Inputs | Latitude, longitude, date | Coordinates + elevation + pressure/temperature + more | City/location name, date |
| Horizon model | Ideal flat horizon | Can model terrain/horizon/elevation | Typically assumes defaults |
| Refraction handling | Standard −0.833° convention | Configurable / physical refraction models | Varies; often undocumented |
| Output detail | Sunrise/sunset (and sometimes day length) | Sunrise/sunset + twilight + azimuth + solar noon | Usually sunrise/sunset only |
| Best for | Planning, quick estimates anywhere on Earth | High-precision needs (aviation, research) | Convenience for common places |
It depends on how the page converts solar time to clock time. If it uses your device/browser time zone, DST is typically applied automatically for your current zone, but that may not match the coordinates you entered if they are in a different region.
Small differences (often a few minutes) can come from different refraction assumptions, rounding, elevation/horizon differences, or the time zone used to display results.
Use positive values for east longitudes and negative values for west longitudes (e.g., London ~ −0.13, Tokyo ~ +139.7, New York ~ −74.0).
Yes. At very high latitudes, some dates have continuous daylight (midnight sun) or continuous night (polar night). The calculator should indicate when sunrise/sunset does not occur on that date.
No. Sunrise/sunset uses the −0.833° convention. Twilight (civil/nautical/astronomical) uses different solar elevation thresholds (e.g., −6°, −12°, −18°) and is not the same as sunrise/sunset.