Sun position and shadow calculator
See where the sun is over your house on any day: when it rises and sets, which walls and windows get sun, how long shadows are, and how far apart to set rows of solar panels.
Place and day
Enter a place and a day. You see where the sun is hour by hour, which sides of the house get sun and how long the shadows are.
Denver · 39.7400° N, 104.9900° W
Your device uses UTC+0 on this date. Change it only if the place is in another time zone.
Blue: the chosen day, with clock hours. Dashed: the longest day, the equinox and the shortest day. The grey bar is the shadow of the object in the centre.
Shadow
A tree, a neighbour's house, a fence or a wall. The shadow is measured on level ground.
Row spacing for solar panels on a flat roof
How far apart rows of tilted panels must stand so that one row does not shade the next. Designers usually keep the rows free of shade on the shortest day between 10:00 and 14:00 solar time.
The side of the panel or rack that slopes, for example 1.72 m for a portrait panel.
Degrees from north, clockwise: 180 = south, 90 = east. Now 180°.
Add this calculator to your website
Free for any website: paste this code where the calculator should appear. It keeps itself up to date, fits its height to the content and links back to the full page with the explanations.
How to use it
- 01Paste the coordinates of your house or garden, or press "Use my location" while you stand there.
- 02Pick a date. The links under the date jump to the longest day, the equinox and the shortest day.
- 03Check the clock offset. It starts with your device time zone; change it if the place is somewhere else.
- 04Move the time slider to see where the sun stands and which way shadows fall.
- 05Enter the height of a tree, a fence or the neighbour's house to see how long its shadow is at that moment.
- 06For a flat roof with tilted panels, open the row spacing section and enter the panel length and tilt.
How it is calculated
The sun position comes from the equations NOAA uses in its solar calculator, which are based on Astronomical Algorithms by Jean Meeus. We compared the results with the NREL Solar Position Algorithm: the direction agrees within 0.05° and sunrise and sunset within a minute.
- Elevation of the sun
- sin h = sin φ × sin δ + cos φ × cos δ × cos H
- Solar noon
- noon = 12:00 − 4 min × longitude − equation of time + clock offset
- Shadow length
- L = height ÷ tan h
- Gap between panel rows
- gap = panel length × sin(tilt) ÷ tan h × cos(sun azimuth − panel azimuth)
- Row pitch
- pitch = panel length × cos(tilt) + gap
φ is the latitude, δ the declination of the sun on that day and H the hour angle, 15° for every hour from solar noon. Sunrise and sunset are the moments the centre of the sun is 0.833° below the horizon, which allows for the bending of light in the air and the size of the sun's disc.
Hours of direct sun on a wall are counted every 10 minutes: the sun must be above the horizon and less than 90° to either side of the direction the wall faces.
For panel rows, the gap is checked every 5 minutes inside the time window on the shortest day and the largest value is kept. Designers commonly use 10:00 to 14:00 solar time; a wider window gives less shade and fewer rows.
Hills, trees and buildings on the horizon are not included. They shorten the sunny hours, most in winter when the sun is low.
Worked example
A 10 m tree south of a garden in Berlin on 21 December
- Berlin is at 52.52° N. On 21 December the declination is −23.44°.
- Highest sun at solar noon: 90° − 52.52° − 23.44° ≈ 14°.
- Shadow of the tree at noon: 10 ÷ tan 14° ≈ 40 m.
- The same tree on 21 June, with the sun at 61°: 10 ÷ tan 61° ≈ 5.6 m.
Getting the order right
Look at the shortest day before planting or building
A shadow that is short in summer can cover the whole garden in winter. Check 21 December (21 June south of the equator) for anything that should get winter sun, such as solar panels or a greenhouse.
Measure the height above the surface you care about
For shade on a roof, use the height of the tree or building above the roof, not above the ground.
Mind daylight saving time
The calculator uses the clock offset you give it. In summer most of Europe and North America are one hour ahead of their winter time.
East and west walls share the day
An east window gets the morning, a west window the afternoon. In summer the west side also gets the hottest hours.
Common mistakes
- Using the time zone of your phone when the house is in another country.
- Planning panel rows for summer only. Rows set for June shade each other badly in December.
- Measuring the panel tilt from the vertical. The tilt here is from the horizontal: a flat panel is 0°.
- Forgetting that the compass needle points to magnetic north. The directions here are true north, which can differ by several degrees.
Questions
Which side of the house gets the most sun?
North of the tropics, the south side gets sun all day in winter and the most hours over the year. In summer the east and west sides get long morning and evening sun too, and even a north wall gets some early and late sun.
How long is a shadow?
Height divided by the tangent of the sun's elevation. At 45° the shadow is as long as the object is tall; at 14° it is about four times as long.
How far apart should rows of solar panels be?
Far enough that the top edge of one row does not shade the next one on the shortest day around midday. The calculator gives the gap for any window you choose; 10:00 to 14:00 solar time is a common choice.
Why does the sunset time differ from my weather app?
Weather apps also use 0.833° below the horizon, so the times usually agree within a minute. A different time zone or daylight saving setting is the usual cause of a larger difference.
Related calculators
Sources
- [1]Solar Calculation Details (NOAA Solar Calculator). NOAA Global Monitoring Laboratory. Sun position from the equations of Jean Meeus, Astronomical Algorithms, with the NOAA refraction fit; sunrise and sunset with 0.833° of refraction, accurate to about a minute between 72° N and 72° S for 1800–2100.. Checked November 18, 2026
- [2]Solar Position Algorithm (I. Reda, A. Andreas, NREL/TP-560-34302), in pvlib-python 0.16. National Renewable Energy Laboratory. Check of our results: azimuth within 0.05°, elevation within 0.03° (0.15° at the horizon), sunrise and sunset within a minute.. Checked November 18, 2026
- [3]Row Spacing (HelioScope help centre). Aurora Solar / HelioScope. Row spacing set so that rows do not shade each other during a time window, typically the winter solstice from 10 am to 2 pm; ground coverage ratio = module area ÷ array area.. Checked November 18, 2026
Formulas and sources last checked on November 18, 2026. How we calculate