Daylight Hours Calculator
Introduction: estimating daylight hours by latitude and date
This daylight hours calculator estimates the geometric photoperiod—the time between idealized sunrise and sunset—for a latitude and day of the year. It applies standard solar geometry to estimate how long the Sun remains above a level, unobstructed horizon.
Use the daylight estimate to compare seasonal changes at one location, contrast latitudes, or make an initial plan for gardening, outdoor activity, and seasonal solar availability. For official sunrise or sunset times at a particular address, consult an astronomical or weather service.
- Solar declination approximation: Cooper, P. I. (1969), The absorption of radiation in solar stills, Solar Energy 12(3), 333–346 — the 23.45° sine model reproduced in Duffie and Beckman, Solar Engineering of Thermal Processes.
- Sunrise hour angle and daylength: Iqbal, M. (1983), An Introduction to Solar Radiation (Academic Press), chapter 1. The same relation is set out in the NOAA solar-calculation details.
- The −0.833° sunrise and sunset altitude — 34 arcminutes of mean atmospheric refraction plus the Sun’s 16-arcminute semi-diameter — and the −6° civil-twilight threshold follow the U.S. Naval Observatory definitions of rise, set and twilight.
- Cross-check: for Berlin (52.5° N) on day 172, this page returns 16 h 50 m with the −0.833° option, matching the 04:43–21:33 sunrise-to-sunset span published by the NOAA Global Monitoring Laboratory Solar Calculator to within a minute.
How to use the daylight hours calculator
For a daylight-duration estimate, enter a geographic latitude and a numbered day of the year; the calculator returns photoperiod in decimal hours and hours:minutes and draws the annual curve for that latitude.
- Enter your latitude in decimal degrees — positive north of the Equator, negative south. For example, Sydney is about −33.9° and Reykjavík is about 64.1°.
- Enter the day of year from 1 (1 January) to 366 (31 December in a leap year). The equinoxes fall near days 80 and 264; the solstices near days 172 and 355.
- Choose a sunrise definition. “Geometric horizon, 0°” matches the textbook formula below. “Apparent sunrise/sunset, −0.833°” adds the standard allowance for atmospheric refraction and the Sun’s upper limb and reproduces almanac and NOAA times. “End of civil twilight, −6°” reports the longer window of usable outdoor light.
- Select “Compute daylight.” The result panel reports the modeled daylength together with the solar declination for that day, and the annual curve plots photoperiod for every day with your selected day marked. “Reset” clears the inputs and the chart.
Once you have a feel for the numbers, the Solar Analemma puzzle lower down the page runs the same declination and hour-angle equations on a globe and a horizon dome, and challenges you to hit specific day lengths by steering latitude and date.
Formula: how daylight hours are calculated
The daylight-hours calculation combines Earth’s axial tilt (about 23.45°) with its annual orbital position. The model uses two central angles:
- Latitude : your position north (positive) or south (negative) of the Equator, in degrees.
- Solar declination : the latitude at which the Sun is directly overhead at solar noon on the selected day.
For day-of-year (1–366), the calculator uses this commonly used solar-declination approximation in degrees:
That approximation follows the annual north–south movement of the Sun’s apparent path: is positive while the Sun is north of the Equator and negative while it is south of the Equator. Before evaluating tangent and inverse-cosine functions, the script converts the latitude and declination from degrees to radians:
After finding , the calculator obtains the sunrise hour angle , the angular rotation from solar noon to either idealized sunrise or sunset:
Formula: cos h_s = − tan φ ⋅ tan δ
The calculator converts the resulting hour angle from degrees of Earth rotation to the photoperiod , expressed in hours:
Formula: N = 2 / (15 ° /h) ⋅ arccos (− tan φ ⋅ tan δ)
The factor is used because:
- Earth rotates about 15° per hour (360°/24 h).
- Daylight runs from sunrise to solar noon and from solar noon to sunset, so the hour angle is doubled.
At polar latitudes, the expression may lie outside . The daylight model then represents continuous day as 24 hours or continuous night as 0 hours, and the calculator reports the corresponding condition.
Choosing the horizon altitude
The formula above puts sunrise at the moment the Sun’s centre crosses a perfectly level horizon. Almanacs instead place sunrise at a solar altitude of , which allows about 34 arcminutes for mean atmospheric refraction plus the Sun’s 16-arcminute semi-diameter. The sunrise-definition menu selects that altitude, and the calculator then solves the general form:
Setting collapses the fraction back to , so the two expressions are one equation carrying two conventions. At middle latitudes the refraction allowance lengthens the reported day by roughly six to ten minutes; near the polar circles it can move the first day of the midnight sun by several days.
Interpreting daylight-hours results
A daylight-hours result is the idealized photoperiod for the latitude and day you selected, rather than a pair of local clock times. Read the value in its seasonal and geographic context:
- Short days (for example, 8–10 hours) generally indicate winter in that hemisphere, with a limited interval of natural light.
- Near-12-hour days are typical near the equinoxes, when the model produces broadly similar daylight durations across latitudes.
- Long days (15+ hours) indicate a summer date at a middle or high latitude.
- 24 hours means the model has reached continuous daylight, while 0 hours means continuous darkness.
Daylight hours computed at the geometric horizon assume a sea-level view with nothing in the way. Refraction alone adds several minutes, and topography or local obstructions can add or remove several more; switch the sunrise definition to −0.833° when you want a number comparable with a published sunrise and sunset table.
Worked example: Berlin daylight near the June solstice
This daylight-hours example uses Berlin, Germany (about 52.5° N), near the June solstice at day-of-year .
-
Set the daylight inputs.
- Latitude (positive in the Northern Hemisphere).
- Day-of-year .
-
Estimate solar declination.
Near the June solstice, is close to +23.45°. The calculator’s declination expression yields a value very close to that seasonal maximum. -
Evaluate the sunrise hour-angle term.
The calculator converts and to radians internally and evaluates . At 52.5° and approximately 23.45°, the result remains between −1 and 1, so the model has a normal sunrise and sunset. -
Convert the hour angle to daylight duration.
Using and gives 16 h 35 m (16.59 hours) of idealized daylight. Switching the sunrise definition to the −0.833° apparent convention returns 16 h 50 m, which is the figure a Berlin almanac prints.
The example illustrates why a mid-latitude Northern Hemisphere location has a much longer modeled photoperiod near the June solstice than near the December solstice. Actual published daylight durations can differ because they use observational sunrise and sunset conventions.
How latitude and season shape daylight hours
The daylight curve produced by this calculator shows a different seasonal pattern at every latitude. At the Equator it stays at 12 hours in this geometric model, while moving north or south increases the difference between the two solstices.
| Latitude | Near the June solstice | Near the December solstice | Daylight-hours pattern |
|---|---|---|---|
| 0° (Equator) | 12 hours in the model | 12 hours in the model | Very little seasonal change in geometric daylength |
| 30° N | Longer than 12 hours | Shorter than 12 hours | A noticeable but moderate annual daylight swing |
| 50° N | Substantially longer days | Substantially shorter days | Strong contrast between summer and winter photoperiod |
| Near the Arctic Circle | May approach continuous daylight | May approach continuous darkness | Small date or latitude changes can have large effects |
| 35° S | Shorter than 12 hours | Longer than 12 hours | Seasonal pattern opposite to the Northern Hemisphere |
Run the daylight calculator for dates around days 80, 172, 264, and 355 to inspect equinox and solstice behavior at a chosen latitude. The annual graph is especially useful for seeing whether the transition in daylight is gradual or rapid at that location.
Practical uses for calculated daylight duration
Calculated daylight hours can help compare the seasonal availability of natural light before more detailed site-specific planning:
- Agriculture and gardening: Compare spring and summer photoperiods when considering long-day or short-day plant responses and the daylight available for field work.
- Solar energy and off-grid systems: Use seasonal daylight duration as context for changes in solar opportunity, then combine it with irradiance, panel, shading, and storage data.
- Outdoor work and events: Check how much natural-light duration a date is likely to offer before selecting shifts, classes, or events.
- Ecology and biology: Use photoperiod as one environmental indicator relevant to migration, breeding cycles, and plant phenology.
For a fuller picture of solar conditions, pair daylight duration with a solar-declination or solar-altitude calculation for the same date and latitude.
Assumptions and limitations of the daylight-hours model
This daylight-hours calculator deliberately uses a simplified solar-geometry model. Those assumptions make the photoperiod quick to calculate, but they also explain differences from official local sunrise and sunset listings.
- Spherical Earth with no terrain: Mountains, hills, buildings, and trees are excluded. A real horizon above or below the ideal horizon changes observed sunrise and sunset.
- Refraction is a fixed allowance, not a forecast: The −0.833° option applies the standard mean refraction of 34 arcminutes. Real refraction varies with temperature, pressure and humidity, and it grows unreliable when the Sun is close to the horizon at high latitudes, so treat the apparent-sunrise result as an almanac-grade estimate rather than an observation.
- Observer elevation is ignored: Standing on a mountain or a tall building lowers the visible horizon and lengthens the day by minutes. The calculator always assumes an observer at the horizon plane.
- Sunrise definition is a choice, not a fact: Under the default geometric option the Sun is treated as a point crossing a level horizon. The menu offers the almanac convention (−0.833°) and civil twilight (−6°); each answers a different question and none of them is the single correct daylength.
- Day-of-year treatment: The input runs from 1 to 366 so leap-year day numbers can be entered. The declination approximation itself uses a 365-day cycle, so it is an approximation rather than a calendar-specific ephemeris.
- Latitude range and polar regions: The calculator accepts latitudes from −90° to 90° and detects modeled polar day or polar night. Close to either polar circle, small changes in or can cause very large changes in calculated daylight.
- No time zones or clock times: The output is a duration, not local sunrise or sunset clock time. Longitude, time zones, and daylight saving time are outside this calculator’s scope.
Use these daylight results for comparison, education, and preliminary planning rather than safety-critical navigation or legal timekeeping.
FAQs about daylight length and accuracy
Why do daylight hours increase in summer and decrease in winter?
Earth’s axial tilt changes the Sun’s apparent daily path through the year. During a hemisphere’s summer, that hemisphere is tilted toward the Sun, so the Sun follows a higher, longer path above the ideal horizon. During winter it follows a lower, shorter path, reducing the geometric photoperiod.
How does latitude change calculated daylength?
At low latitudes, the calculator returns values close to 12 hours throughout the year. Seasonal differences become much larger toward the poles. At sufficiently high latitudes, the idealized geometry can produce 24 hours of daylight in summer or 0 hours in winter.
Why can the calculator differ from sunrise and sunset times in an app?
By default this calculator measures an idealized geometric daylight duration, which runs six to ten minutes short of an almanac at middle latitudes. Choose the −0.833° apparent sunrise option and the two normally agree to within a minute or two. Any residual gap comes from observer elevation, terrain, local refraction conditions, and the fuller orbital model that published services use.
Which sunrise definition should I choose?
Choose the geometric horizon (0°) when you want the textbook photoperiod that the formula on this page describes, for example when comparing latitudes or reproducing a physics exercise. Choose apparent sunrise and sunset (−0.833°) when you want a number you can hold against an almanac, a weather app, or the NOAA solar calculator. Choose civil twilight (−6°) when what matters is how long there is enough light to work or travel outdoors without artificial lighting.
Is daylight duration enough information for solar-energy planning?
Daylight duration is useful for comparing seasonal opportunity for solar collection, but it does not measure irradiance or electricity output. Solar planning also requires local irradiance, panel orientation and specifications, shading, weather, and storage or load information.
Related tools for daylight and solar geometry
To expand a daylight-hours estimate into a broader solar analysis, consider using related calculators:
- Solar Declination Angle Calculator: Examine the declination used in daylight geometry and how it changes over the year.
- Solar-Powered IoT Sensor Duty Cycle Calculator: Relate available daylight to an estimated device-energy schedule using panel, load, and storage assumptions.
- Solar Panel Cleaning Calculator: Consider how soiling and cleaning may affect energy yield alongside the seasonal daylight pattern.
Solar Analemma: steer latitude and date onto a daylight target
This is the calculator's own geometry turned into a puzzle. Move a latitude marker around the globe and slide the date through the year: the terminator (the day/night line) tilts with the solar declination , the sky dome redraws the Sun's daily arc, and the day-length readout is recomputed live from the same sunrise hour-angle equation the calculator uses. Each round names a target — a photoperiod, the midnight sun, polar night, the twin date with matching daylength, or the subsolar latitude — and you must land inside the tolerance. Every date you visit is stamped onto the analemma panel, so the figure-eight of declination against the equation of time draws itself as you explore.
Round 1 of 8 · TargetPress “Start challenge” to begin. Round 1 asks for a latitude and date with exactly 14 h 30 m of daylight.
- Round 1 / 8
- Latitude 45.0° N
- Date 21 Mar · day 80
- Declination +0.0°
- Day length 12 h 00 m
- Miss by —
- Score 0
- Best 0
Press “Start challenge”, then steer the latitude marker and the date slider until the day-length readout matches the target.
Keyboard (focus the board first): ↑ ↓ change latitude by 1°, ← → change the date by 5 days, hold Shift for fine steps of 0.1° and 1 day, Enter locks in the answer, R restarts the round. Pointer and touch: drag inside the globe or on the latitude rail at its left edge to move the marker, and drag the date slider along the bottom.
- Sunlit part of your latitude circle — its share of the circle is the daylight fraction
- Night side of the terminator
- The Sun's daily arc across the horizon dome
- Analemma segments you have already visited
