Calculate sun position, sunrise and sunset

Computes with the NREL Solar Position Algorithm — cross-validated against the reference implementation to below 0.01 degrees and below one minute. Outputs sunrise and sunset (visible and geometric), solar noon, day length, twilight times and the sun position at any time — plus the sun-path diagram with the three seasonal curves and the site’s terrain horizon.

Input

Input

Place (“Freiburg”) or coordinates (“47.99, 7.84”) · DE / AT / CH

Decimal hours: 13.5 = 13:30. Sets the current sun position.

Fixed offset — the calculator warns on DST changeover days.

Result · Live

Day length
16.83hvisible sunrise to sunset (h = −0.833°)
Solar noon altitude
61.0°altitude at transit — governs row spacing and facade yield
Sun altitude now
58.2°at the set time, refraction included
Azimuth now
150°0° = north, 180° = south — clockwise
Sun paths over the site’s horizon
terrain horizon (PVGIS)6912151821summer solsticewinter solsticesun on 21/6 at 12h45°90°135°180°225°270°315°ESW30°60°

Sunrise 04:43 (azimuth 48°) · sunset 21:33 (azimuth 312°) · solar noon 61° at 13:08 · day length 16.83 h. Civil twilight 03:53–04:43 and 21:33–22:23.

Calculation steps
  • Sun position (NREL SPA): NREL SPA (Reda & Andreas 2004) = 58.203 °
  • Solar noon (ternary search): max h(t), Dreiteilungssuche = 60.946 °

The formulas behind the calculator

Every number above can be recomputed: the full calculation path, all assumptions and the data source with retrieval date — plus cross-validation against independent references. Disclosed, not claimed.

An estimate based on the stated assumptions. The final design must be checked by a qualified professional against the rules that apply where you are.

Data as of: 2026-07-30

Every intermediate value with its formula, number and provenance
StepFormulaValueProvenance
Sun position (NREL SPA)NREL SPA (Reda & Andreas 2004)58.203 °exact
Solar noon (ternary search)max h(t), Dreiteilungssuche60.946 °exact
Formula
NREL SPA (Reda & Andreas 2004): ephemerides + nutation + parallax + refraction · visible rise/set at h = −0.833° · twilight at −6/−12/−18°
Valid for
Years 1950–2050, cross-validated against pvlib (NREL reference): position < 0.01°, event times < 60 s. Times in the chosen fixed zone time (CET/CEST/UTC).
Not covered
Automatic DST switching (the zone offset is an input; the calculator warns on changeover days), observer altitude in the refraction, the obstacle editor for near shading (trees, neighbouring buildings) — the terrain horizon comes from the PVGIS elevation model and inherently misses near obstacles.
Data sources

Frequently asked questions

How accurate is this sun position calculator?

It computes with a complete port of the NREL Solar Position Algorithm (Reda & Andreas 2004) — the reference algorithm used by PVGIS-adjacent tools and pvlib. The port is cross-validated by automated test against the pvlib reference implementation: deviation below 0.01° in altitude and azimuth across 60 reference points, sunrise and sunset times within 60 seconds across twelve events. Any change to the implementation that breaks these thresholds turns the build red.

Why are there a visible and a geometric sunrise?

The geometric sunrise is the moment the sun’s centre passes the mathematical horizon (0°). But the sun becomes visible earlier: atmospheric refraction lifts it by about 0.57°, and half the solar diameter (0.27°) adds on — together the famous −0.833°. That makes several minutes of difference depending on latitude; weather services and calendars quote the visible times, while some PV simulations compute geometrically.

What does the sun-path diagram show — and why the terrain horizon?

The three curves are the sun paths at summer solstice, equinox and winter solstice — every other day of the year lies between them. Underneath sits your site’s terrain horizon from the PVGIS elevation model: where the winter path disappears behind the horizon, your surface gets no direct sun in winter. Exactly this diagram is the standard tool of shading analysis in architecture and PV planning.

Does the horizon include trees and neighbouring houses?

No, inherently not: the terrain horizon comes from an elevation model with roughly 90 m resolution — mountains and ridgelines yes, the neighbour’s tree no. Yet near obstacles are what actually shades real roofs. Until the obstacle editor arrives: measure an obstacle’s azimuth and elevation angle yourself (compass app plus inclinometer) and compare with the path curves — if the obstacle sits above the winter path, it costs yield exactly when yield is scarcest.

Why do I have to choose the time zone myself?

Because automatic DST logic confuses more than it helps on changeover days: in the changeover night one hour exists twice or not at all. The calculator therefore works with a fixed zone offset (CET, CEST or UTC) and warns explicitly on the EU changeover days. For planning, fixed zone time is the cleaner reference anyway — solar noon in Berlin swings only between 11:50 and 12:21 CET across the year (equation of time plus longitude), one hour later in CEST.

What are twilight times good for in PV planning?

Directly, little — but they answer the neighbouring questions of the same diagram: civil twilight (−6°) bounds usable daylight, nautical (−12°) and astronomical (−18°) mark when the sky is truly dark. More relevant off-grid: between visible sunset and darkness lies nearly an hour of residual light without meaningful yield — when planning load profiles, count battery time from sunset, not from darkness.

How high is the sun in December — and in June?

The quick formula for solar noon at the winter solstice is 90° minus latitude minus 23.44°. For Berlin (52.5° N) that gives 14.0°; the calculator's exact value for 21 December is 14.1° (refraction included). Munich reaches 18.5°, Hamburg only 13.1°. On 21 June the sign flips: 90° − latitude + 23.44° — 60.9° in Berlin, 65.3° in Munich. This factor-four swing in noon altitude is why row spacing, facade yield and winter shading are always dimensioned against the December sun, never against the yearly average.

In which compass direction does the sun rise and set?

Only around the equinoxes does the sun rise almost exactly east and set west (Berlin, 20 March: azimuth 89° and 271°). At the summer solstice, sunrise moves far into the northeast — Berlin, 21 June: 04:43 at azimuth 48°, sunset 21:33 at 312° in the northwest, for 16.8 hours of daylight. At the winter solstice it is the southeast: sunrise 08:15 at 129°, sunset 15:54 at 231°, day length just 7.6 hours. The rise point swings across more than 80° of horizon over the year — which is why an east-facing window gets morning sun in summer that it never sees in December.

How do I check the sun path for my house or plot?

Set the location (place search or coordinates), then read the diagram bottom-up: the orange winter curve is the critical one. Everything that pokes above it — terrain horizon, roofs, trees — shades your plot exactly in the months when light is scarcest; the summer curve runs so high that it clears most obstacles anyway. For a planned PV array, balcony system or vegetable bed, compare the obstacle direction (azimuth scale at the bottom) with the curves: an obstruction due south hurts all year, one in the northeast only costs summer morning sun. The rise and set azimuths below the diagram give the exact compass window of direct sun.