Study and Productivity

How to Calculate Shadow Length and the Sun's Angle

Work out the Sun's height and direction for any place and time, then a shadow's length and direction, with London and Dhaka examples and mistakes.

Saizul Amin
Saizul Amin5 Nov 2026 · 3 min read
How to Calculate Shadow Length and the Sun's Angle

How to Calculate Shadow Length and the Sun's Angle

Will the new fence shade the vegetable bed? How long will the shadow of an extension be in December? Where will the sun be at 4 p.m. for an outdoor photo? All of these need the same two numbers, the Sun's height above the horizon and its compass direction, and one formula. The Sun Position and Shadow Length Calculator supplies both for any place and time.

The formula

For an object of height h on flat ground, with the Sun at altitude a:

shadow length = h ÷ tan(a)

Some useful values:

Sun heightShadow as a multiple of height
60°0.58
45°1.00
30°1.73
15°3.73
5°11.4

The shadow points directly away from the Sun, so its direction is the Sun's azimuth plus 180°.

Using the calculator

  1. Choose a city, type coordinates and a time zone, or use your location.
  2. Pick the date.
  3. Slide the time through the day.
  4. Enter the height of the object and choose metres or feet.

Five figures update: Sun height, Sun direction, shadow length, shadow direction and the ratio of shadow to height. A compass drawing shows the Sun as a yellow dot and the shadow as a bar on the opposite side, and a bar chart shows the Sun's height for every hour.

A worked example: a 2 m fence in London

On 21 June 2026:

  • 12:00: Sun 59.5° high at about 151°, shadow 1.18 m
  • 15:00: Sun 54.0° high, shadow 1.45 m

On 21 December 2026:

  • 9:00: Sun 5.6° high, shadow 20.38 m
  • 12:00: Sun 15.1° high, shadow 7.41 m
  • 15:00: Sun 5.3° high, shadow 21.46 m

The same fence that shades just over a metre in summer throws a shadow more than seven metres long at midday in winter. A bed two metres north of it will get sun in June and almost none in December.

A worked example: the overhead Sun

Dhaka lies close to the Tropic of Cancer. At noon on the June solstice the Sun is 89.6° high, almost straight overhead, and a 2 m pole casts a shadow of about one centimetre. At 9:00 the Sun is 48.9° up in the east and the shadow is 1.74 m.

The day table

Below the chart, a table lists each hour the Sun is up with its height, direction and the shadow length. Download day table (CSV) saves all 24 hours for a spreadsheet, which is useful for planning planting, a patio or the position of a solar panel.

Accuracy

The Sun's position uses the standard NOAA and Meeus formulas with atmospheric refraction near the horizon and is accurate to about 0.1°. That is far better than you can measure a real shadow, whose edge is blurred because the Sun is half a degree wide.

Common mistakes

  • Ignoring slopes. A shadow falling downhill is longer and uphill shorter than on flat ground.
  • Using clock time from the wrong zone. If you type coordinates, set the correct time zone name too.
  • Forgetting daylight saving. Times are local, so noon on the clock is not solar noon in summer.
  • Measuring at the wrong point. Measure to the centre of the blurred edge, not the darkest part.
  • Assuming south is always sunny. In the southern hemisphere the midday Sun is in the north.
  • Planning only for summer. Winter shadows are several times longer; check December or June depending on your hemisphere.

Finding north

At solar noon the shadow of a vertical stick points due north in the northern mid-latitudes and due south in the southern. The hourly table shows when the Sun is highest, which is a simple way to check a compass.

This guide is for planning and learning. It is not surveying advice or a statement about rights to light.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages