Sunrise and Sunset Calculator
Presets:
How the times are calculated
The calculator runs the algorithm published by NOAA's Global Monitoring Laboratory, the same mathematics behind official sunrise tables. Two quantities drive everything. The solar declination — how far north or south of the equator the sun's rays fall squarely — swings between +23.44 degrees at the June solstice and -23.44 at the December solstice, and it is what makes days long in one hemisphere and short in the other. The equation of time corrects for the Earth's elliptical orbit and axial tilt, which make the sun run up to 16 minutes "fast" or "slow" against the clock across the year. From the date, both are computed as a fractional-year series; from your latitude and the declination comes the hour angle at which the sun crosses the horizon; from your longitude and the equation of time, that angle becomes a clock time in your time zone.
One refinement matters: sunrise is not when the sun's centre reaches the horizon. By convention it is when the sun's upper edge appears, and the atmosphere bends sunlight by about half a degree, so the calculation uses a zenith angle of 90.833 degrees — the centre of the sun sitting 0.833 degrees below the geometric horizon. That is worth several minutes at temperate latitudes and much more near the poles, and it is why the sun can be seen when geometry alone says it should not be yet.
Day length, seasons and the polar edge cases
Day length is simply sunset minus sunrise, and it is set by latitude more than by anything else. On the equator it barely moves from 12 hours all year. At London's latitude it swings from 7 hours 50 minutes in December to 16 hours 38 minutes in June. At Karachi, nearer the equator, the swing is gentler: about 10 hours 34 minutes to 13 hours 41 minutes. Keep travelling poleward and the swing reaches its logical end: above the Arctic and Antarctic circles there are days when the hour-angle equation has no solution at all — the sun never rises, or never sets. The calculator detects those cases and says so (polar night or midnight sun) instead of printing a nonsense time, which is the correct answer wearing the right clothes.
Twilight stretches the useful light beyond both ends. Civil twilight — the sun up to 6 degrees below the horizon — is when there is still enough light to work outdoors; it lasts roughly 20 to 40 minutes at temperate latitudes and much longer in high-latitude summers, where it can run all night (the "white nights" of St Petersburg and Scotland's simmer dim). Nautical and astronomical twilight extend to 12 and 18 degrees. This page reports the headline sunrise and sunset; photographers chasing the golden hour want the half hour after sunrise and before sunset, and astronomers want the astronomical twilight this page's algorithm can be extended to — both start from the same geometry.
A worked example
New York, 21 June 2026 — the summer solstice. Latitude 40.7128, longitude -74.006, offset UTC-4 (daylight time). The algorithm gives sunrise 5:25 am, sunset 8:31 pm, solar noon at 11:58 am, and a day length of 15 hours 6 minutes. London the same day: sunrise 4:43 am, sunset 9:21 pm — 16 hours 38 minutes, because London sits ten degrees further north and June pays latitude in daylight. Karachi on 24 November 2026, late autumn in the northern hemisphere: sunrise 6:54 am, sunset 5:43 pm, a day of 10 hours 49 minutes, still longer than London manages on the same date. One algorithm, three cities, and the whole of the seasons visible in the differences.
Frequently asked questions
How does the calculator work out sunrise and sunset?
It uses the NOAA solar algorithm. From the date it computes the sun's declination and the equation of time; from your latitude, the hour angle at which the sun's upper edge crosses the horizon (a zenith of 90.833 degrees, allowing for atmospheric refraction); and from your longitude and time zone offset, the clock time. The results match published almanac times to within a minute or two for most places — the same method official sunrise tables are built with.
What coordinates and time offset do I enter?
Latitude is positive north of the equator and negative south; longitude is positive east of Greenwich and negative west. New York is 40.7128, -74.006; Sydney is -33.8688, 151.2093. The UTC offset is your time zone's offset on the date in question, including daylight saving: New York is -5 in winter and -4 in summer; London is 0 in winter and +1 in summer; Karachi is +5 all year. The preset buttons fill all three in for their cities.
Why is solar noon not at 12:00?
Because clock time is averaged and standardised, while the sun keeps local apparent time. Two effects separate them: your position within the time zone (the sun crosses the meridian four minutes later for every degree of longitude west of the zone's central meridian) and the equation of time, which shifts apparent solar time by up to 16 minutes across the year. New York's solar noon on 21 June falls at 11:58 am; in November it drifts to about 11:42. Sundials show solar noon; clocks mostly do not.
What happens during polar day and polar night?
Above the polar circles (about 66.56 degrees latitude) the sun can stay above or below the horizon for a full day or longer. The sunrise equation then has no solution — there is no hour angle at which the sun crosses a horizon it never reaches — and the calculator reports midnight sun or polar night instead of a time. Near the boundary the day length approaches 0 or 24 hours, and twilight can last all night even when the sun does technically set.
How accurate are these times?
Within about one to two minutes for most inhabited latitudes, against official almanac values. The main error sources are local: elevation (a hilltop sees the sun earlier than the valley floor — roughly a minute per 1.5 km of height, plus the visible horizon may not be the sea-level horizon the formula assumes), and weather, since refraction varies slightly with temperature and pressure. For planning a hike, a fast or a photo, the times are as good as any published table.
Related tools
Algorithm checked on 24 November 2026 against published almanac times for New York, London and Karachi. Everything is calculated in your browser — nothing you type is sent anywhere.