How to use the day length calculator
Estimate hours of daylight from latitude and day of the year. Enter latitude, day of year in the fields above; the solar declination, daylight hours are computed instantly and plotted on the chart so you can see how the answer changes.
Common searches this calculator answers include “how long is the day”, “sunrise to sunset”, “summer solstice daylight”, “calculate day length”, “find solar declination”.
Formula
Variables
- lat — Latitude (°)
- n — Day of year
Worked example
With latitude = 40 °, day of year = 172, the calculator gives solar declination ≈ 23.43978 °; daylight hours ≈ 14.84452 h.
Frequently asked questions
What is the day length calculator used for?
Estimate hours of daylight from latitude and day of the year. It helps with questions such as “how long is the day”, “sunrise to sunset”, “summer solstice daylight”.
What is the formula for the day length calculation?
Solar declination (°) = 23.44 × sin(360 / 365 × (284+n)). Daylight hours (h) = 24 / π × acos(max(-1,min(1,-tan(lat) × tan([Solar declination])))). Here lat is latitude (°), n is day of year.
What inputs do I need for the day length (daylight hours) calculator?
You need latitude in °, day of year. Each field is pre-filled with a typical example so you can see how the result responds as you edit the numbers.
How do I use the day length calculator?
Type values into the input fields. Results and the chart update instantly. Use Reset to restore the example values, Copy results to paste them elsewhere, or Share to copy a link that preserves your inputs.
Is the day length result exact?
Calculations use standard formulas and double-precision arithmetic, then display about seven significant figures. Real-world measurements carry uncertainty, so treat results as estimates unless your inputs are exact.