Time, Date, Navigation & Astronomy Sunrise, Twilight & Sun Geometry NOAA solar position algorithm (after Meeus, Astronomical Algorithms)

Daylight Hours and Day Length Calculator

This calculator gives the hours of daylight at any latitude on any date, together with the change from the day before, the longest and shortest days that latitude ever sees, and the full annual curve. Day length depends on only two things — your latitude and the Sun's declination — so longitude and time zone play no part. Choose the geometric horizon, the refracted horizon used for published sunrise times, or the civil twilight threshold that better matches usable working light.

Calculator

This calculator runs in your browser. Enable JavaScript for live results — the inputs, formula and worked example below remain fully readable without it.

Inputs this calculator takes, with typical values
InputWhat to enterExample
LatitudePositive north, negative south, in decimal degrees. Longitude does not affect day length.40.7128 °
Horizon referenceWhich solar altitude counts as the start and end of the day; −0.833° matches published sunrise and sunset times.Refracted (−0.833°, standard sunrise)
YearFour-digit year; declination changes only slightly from year to year.2026
MonthMonth number, 1 for January through 12 for December.6
DayDay of the month.21

It returns

  • Daylight — Hours and minutes between the two horizon crossings.
  • Day length in decimal hours
  • Night length
  • Change from yesterday — Positive while days are lengthening, negative while they shorten.
  • Solar declination
  • Longest day at this latitude
  • Shortest day at this latitude
  • Annual swing — Longest day minus shortest day.

The formula

L=215arccos[sinh0sinφsinδcosφcosδ]
ΔL=L(N+1)L(N)

In plain text: ω₀ = arccos[(sin h₀ − sin φ sin δ) / (cos φ cos δ)]; L = 2ω₀ / 15 hours; night = 24 − L

  • LDay length (hours)
  • ω₀Half-day hour angle: the rotation from noon to the horizon crossing (degrees)
  • h₀Solar altitude that defines the crossing: 0°, −0.833° or −6° (degrees)
  • φLatitude, positive north (degrees)
  • δSolar declination on the date, between ±23.44° (degrees)

Longitude does not appear. It shifts when the day starts and ends but not how long it lasts, which is why two places on the same parallel always share a day length.

Updated Category Sunrise, Twilight & Sun Geometry Verified against published test cases Reading time 11 min

Day length depends on two numbers only

How long the Sun is above your horizon is set entirely by your latitude and the Sun's declination on that date. Longitude has no effect at all — it moves the clock times of sunrise and sunset together, leaving the interval between them unchanged. Lisbon and Ankara sit near the same parallel and share a day length to within a minute, despite being nearly forty degrees of longitude apart.

Declination is the Sun's angular distance north or south of the celestial equator. It swings between +23.44° and −23.44° over a year because the Earth's rotation axis is tilted by that amount relative to its orbit, and it is the sole reason seasons exist. When declination matches the sign of your latitude, your hemisphere is tipped toward the Sun and the days are long.

The two combine through a single spherical-trigonometry expression, and the shape of that expression explains everything you observe. At the equator the sinφ term vanishes, so day length is nearly constant all year. Toward the poles the same term grows until the fraction leaves the range of the arccosine altogether, at which point the Sun simply does not cross the horizon: polar day or polar night.

Because the relationship is a cosine, the rate of change is not uniform. Around the solstices declination is at a turning point and day length barely moves for a fortnight; around the equinoxes declination is changing fastest and so is the day. That asymmetry is why the second half of February feels like it gains light so much faster than early January does, and the change-from-yesterday figure on this page quantifies it.

The formula, one variable at a time

The half-day hour angle is ω₀ = arccos[(sin h₀ − sin φ sin δ) / (cos φ cos δ)]. Hour angle is measured in degrees of Earth rotation from local noon, so the Sun is above h₀ from −ω₀ to +ω₀, a total of 2ω₀ degrees. Dividing by 15° per hour gives L = 2ω₀/15 hours.

The horizon altitude h₀ is a definition, not a physical constant, and this calculator lets you pick which one you mean. Zero degrees is the geometric horizon with the Sun's centre exactly level with you. Minus 0.833° is the convention behind every published sunrise time: it allows 16 arcminutes for the Sun's angular radius so the upper limb rather than the centre is at the horizon, plus about 34 arcminutes for mean atmospheric refraction. Minus 6° is civil twilight, the point at which outdoor activity generally needs artificial light — the twilight times calculator covers the deeper thresholds.

Declination is computed here through the full NOAA chain rather than the familiar classroom approximation δ = 23.44°·sin[360°(284 + N)/365], which is Cooper's 1969 formula. Cooper's version is fine for engineering estimates but is out by up to a few tenths of a degree, and near the equinox a tenth of a degree of declination is worth a couple of minutes of day length at mid-latitudes. The solar declination calculator sets out the accurate chain.

The daily change is computed exactly as it sounds: day length today minus day length yesterday, converted to minutes. It is zero at the solstices and largest at the equinoxes, and it grows steeply with latitude — which is why the same calendar date feels so different in Rome and in Reykjavík. The dates of those turning points come from the equinox and solstice calculator.

Worked example: daylight at 45°N on the two solstices

Take latitude 45°N with the standard refracted horizon, h₀ = −0.833°.

  1. June solstice, δ = +23.44°. sin h₀ = −0.014538; sin 45° sin 23.44° = 0.707107 × 0.397766 = 0.281279; cos 45° cos 23.44° = 0.707107 × 0.917490 = 0.648754.
  2. Hour angle. cos ω₀ = (−0.014538 − 0.281279) / 0.648754 = −0.455977, so ω₀ = 117.128°.
  3. Day length. 2 × 117.128 / 15 = 15.617 h = 15 h 37 m. Night is 24 − 15.617 = 8.383 h.
  4. December solstice, δ = −23.44°. The middle term changes sign, so the numerator is −0.014538 + 0.281279 = +0.266741.
  5. Hour angle. cos ω₀ = 0.266741 / 0.648754 = 0.411159, so ω₀ = 65.722°.
  6. Day length. 2 × 65.722 / 15 = 8.763 h = 8 h 46 m.
  7. Annual swing. 15.617 − 8.763 = 6.854 hours between the longest and shortest day.

Now do the same at 60°N to see how sharply latitude bites. sin 60° sin 23.44° = 0.866025 × 0.397766 = 0.344495 and cos 60° cos 23.44° = 0.5 × 0.917490 = 0.458739, so at the June solstice cos ω₀ = (−0.014538 − 0.344495)/0.458739 = −0.782653, ω₀ = 141.504° and the day is 2 × 141.504 / 15 = 18.867 h. In December the numerator becomes +0.329957, cos ω₀ = 0.719270, ω₀ = 44.006° and the day is 5.867 h — an annual swing of 12.999 hours, nearly double the swing at 45°N for only fifteen degrees more latitude.

Day length by latitude and solar declination

Each cell is 2·arccos[(sin(−0.833°) − sinφ sinδ)/(cosφ cosδ)]/15, rounded to the minute. Southern latitudes use the same table with the sign of δ reversed.
Declination30°N45°N60°N
+23.44° (June solstice)12 h 07 m14 h 05 m15 h 37 m18 h 52 m
+20°12 h 07 m13 h 45 m15 h 02 m17 h 31 m
+15°12 h 07 m13 h 19 m14 h 14 m15 h 57 m
+10°12 h 07 m12 h 55 m13 h 31 m14 h 37 m
+5°12 h 07 m12 h 31 m12 h 50 m13 h 23 m
0° (equinox)12 h 07 m12 h 08 m12 h 09 m12 h 13 m
−5°12 h 07 m11 h 45 m11 h 29 m11 h 04 m
−10°12 h 07 m11 h 21 m10 h 48 m9 h 52 m
−15°12 h 07 m10 h 57 m10 h 06 m8 h 34 m
−20°12 h 07 m10 h 31 m9 h 20 m7 h 05 m
−23.44° (December solstice)12 h 07 m10 h 13 m8 h 46 m5 h 52 m

The equator column reads 12 h 07 m at every declination: with sinφ = 0 the numerator is fixed at sin(−0.833°), and the cosδ in the denominator moves the answer by less than a minute across the whole year.

How to read the result

Compare the day length against the longest and shortest figures for your latitude, because those bracket everything the year can do. At the equator the swing is essentially zero; at 45° it is a little under seven hours; at 60° it is thirteen. That single number tells you how much seasonal signal your location carries.

The change-from-yesterday figure is the one people actually feel. It passes through zero at each solstice, which is why the days seem stuck for a fortnight around midwinter, and it peaks at the equinoxes. It also scales strongly with latitude, so a Scandinavian spring gains light several times faster per day than a Mediterranean one.

Watch which horizon definition you have selected before comparing against another source. Geometric, refracted and civil-twilight day lengths differ by tens of minutes at mid-latitudes, and by hours near the polar circles. Published almanac and newspaper sunrise tables use the refracted −0.833° convention, so pick that when you want a like-for-like comparison, and use the sunrise and sunset calculator when you want the clock times themselves.

Near a polar circle the answer becomes very sensitive. A tenth of a degree of assumed refraction can move the first 24-hour day by days of calendar date, so treat the exact onset of the midnight sun as approximate. In the polar regime the day-over-day change reads zero, because the day length is pinned at 24 or 0 and genuinely is not changing.

Assumptions and limits

  • A flat, unobstructed horizon is assumed. Terrain, buildings and forest all shorten the observed day and no latitude-based formula can know about them.
  • Refraction is taken as the standard 34 arcminutes. Real refraction depends on the temperature and pressure profile and varies most at exactly the low altitudes that matter here.
  • Elevation is not modelled. Standing high above the surrounding terrain lowers your horizon and lengthens the day; the sunrise and sunset calculator includes that dip correction.
  • Day length is not the same as usable light. Civil twilight adds a substantial period at each end, and at high latitudes that period can last for hours.
  • Declination is treated as constant through the day. It moves by up to about 0.4° in 24 hours near the equinoxes, so sunrise and sunset see slightly different values; the effect on day length is under a minute.
  • The result is independent of time zone and daylight saving. Those change when the day starts on the clock, never how long it lasts.

Photoperiod is the biological version of this number

Many plants and animals time their development from day length rather than from temperature, because day length at a given latitude repeats identically every year while temperature does not. Growers who need to advance or delay flowering therefore extend or interrupt the dark period with lamps or blackout cloth, and poultry and dairy operations manage light schedules for the same reason. When you look up a photoperiod requirement for a species, check which threshold the source used: horticultural work often counts civil twilight as effective light, so a requirement quoted against “daylight” can mean something closer to the −6° setting on this page than the −0.833° one. Selecting the wrong threshold shifts the answer by roughly half an hour at mid-latitudes and by considerably more further north.

This page answers “how much daylight”. For “when”, use the sunrise and sunset calculator, which needs longitude and a UTC offset because clock times do depend on them. For the low-light windows before dawn and after dusk, the twilight times calculator handles the civil, nautical and astronomical thresholds and the golden hour.

The two inputs behind this calculation each have their own tool. The solar declination calculator gives δ for any date, and the equinox and solstice date calculator gives the exact instants when it reaches zero and its extremes — the dates on which the change-from-yesterday figure here peaks and vanishes.

If you are working on solar gain rather than solar timing, day length is only part of the story: the Sun's altitude at noon determines irradiance far more than the length of the day does. The sun shadow length calculator converts altitude into shadow geometry, which is the quantity that actually drives overshadowing studies and panel spacing.

Key terms

Photoperiod
The length of the light period in a 24-hour cycle, as experienced by an organism. Biologically it often includes twilight, so it can exceed the sunrise-to-sunset interval.
Declination
The Sun's angular position north or south of the celestial equator on a given date, ranging over ±23.44°.
Hour angle
Degrees of Earth rotation from local solar noon. Fifteen degrees is one hour, so the half-day angle converts straight into time.
Polar day and polar night
The regimes where the arccosine has no solution because the Sun's daily circle never crosses the chosen altitude, so it stays up or stays down for the full 24 hours.

Frequently asked questions

How many hours of daylight are there at the equinox?

Slightly more than twelve everywhere, and increasingly more the further you are from the equator. At the equator it is 12 h 07 m, at 45° it is 12 h 09 m and at 60° it is 12 h 13 m. The excess comes from defining sunrise by the upper limb at the refracted horizon rather than the Sun's centre at the geometric one; the cos φ in the denominator is what makes the excess grow with latitude.

How much daylight do we gain each day?

It depends on latitude and on where you are in the year. The gain is zero at each solstice, rises to a maximum at the equinoxes, and is far larger at high latitudes than at low ones. The change-from-yesterday output on this page gives the figure for your exact latitude and date, and the generated table shows how it evolves month by month.

Does longitude affect day length?

No. Longitude shifts sunrise and sunset by the same amount, so the interval between them is unchanged. Two places on the same parallel have the same day length regardless of how far apart they are east to west, which is why this calculator does not ask for longitude at all. Clock times do need it, and the sunrise and sunset calculator asks for it.

Why does the sunset start getting later before the shortest day?

Because sunrise and sunset are not symmetric about the solstice — the equation of time is shifting solar noon later through December, which moves both events later at once. The earliest sunset therefore falls before the December solstice and the latest sunrise after it, while day length itself still bottoms out exactly at the solstice. The equation of time calculator shows the term responsible.

Which horizon setting should I choose?

Use −0.833° to match published sunrise and sunset tables, since that is the convention almanacs use. Use 0° only when you want the pure geometric result for a calculation of your own. Use −6° when what you care about is usable outdoor light, because civil twilight adds a meaningful working period at each end of the day.

What is the longest possible day?

Twenty-four hours, anywhere above roughly 66.5° latitude, where the Sun's daily circle stops crossing the horizon near the solstice. The exact latitude at which the first 24-hour day appears is a little below the geometric polar circle because of the refraction allowance, and it is quite sensitive to the refraction you assume.

Why is the annual swing so much bigger at 60° than at 45°?

Because the sin φ sin δ term grows while the cos φ cos δ denominator shrinks, so the fraction inside the arccosine moves much further for the same change in declination. Working the two solstices at 60°N gives 18.867 h and 5.867 h, a swing of 12.999 hours, against 6.854 hours at 45°N — nearly double for fifteen degrees more latitude.

Is day length the same every year on a given date?

Very nearly. Because the leap-year cycle shifts the calendar against the orbit by up to about six hours, the declination on a fixed calendar date varies slightly from year to year, and day length with it. At mid-latitudes near the equinoxes the variation is a minute or two; near the solstices it is negligible.

References