Shadow length and direction calculator

Calculate the length and direction of the shadow of any object for a place, date and time, or work backwards from a measured shadow to the height of an object. See how the shadow changes through the day.

2:36 AM

The sun is below the horizon, so there is no shadow.

Side view 2.0 ft

Tap or click the map to move the spot. On a phone, move and zoom with two fingers; with a mouse, drag and scroll.

Path of the shadow tip

Path of the shadow tip1×2×3×NESW

Seen from above: the object stands in the centre. Lines show where the tip of its shadow moves during the day (solid: selected day, dashed: solstices).

Shadow length through the day

Shadow length through the day0×1×2×4×6×8×10×
12a6a12p6p12a

Calculated with Astronomy Engine, an open-source library verified against the US Naval Observatory and NASA JPL. How we calculate

How to use this tool

  1. Set place, date and time with the controls at the top, or press play to animate the day.
  2. Enter a height (for example a 2 m pole, a 10 m tree or a 30 m building) in metres or feet.
  3. Read the result: shadow length, the direction the shadow points, the sun’s elevation and the shadow-to-height ratio.
  4. Go backwards: switch to “Height from shadow” and enter a measured shadow length to get the height of the object.

The formula

The sun’s rays, the object and its shadow form a right-angled triangle, so:

  • Shadow length L = h ÷ tan(α)
  • Height h = L × tan(α)
  • Sun elevation α = arctan(h ÷ L)

where h is the height and α the sun’s elevation. At 45° a shadow is as long as the object; at 30° it is 1.73 times as long; at 10° it is 5.7 times as long. The guide how to calculate shadow length has more examples.

The charts

  • Side view shows the object, the sun’s rays and the shadow for the selected moment.
  • Path of the shadow tip shows, from above, where the tip of the shadow moves during the day. The dashed curves are for the solstices. On the equinoxes the path is almost a straight east-west line.
  • Shadow length through the day shows the shadow as a multiple of the object’s height, shortest at solar noon.

Worked example

In Ljubljana on the June solstice at 16:00, the sun is about 48° high in the west-south-west (azimuth about 253°), so a 10 m tree casts a shadow of about 9 m towards the east-north-east. On the December solstice at solar noon the sun is only about 20.5° high, and the same tree casts a shadow of about 27 m pointing due north.

Uses

Planning where to put a garden bed, estimating how far a new building’s shadow will reach, measuring the height of a tree, or making a simple sundial: all need the same simple geometry.

Last updated September 23, 2026

Frequently asked questions

How is shadow length calculated?

Shadow length = height ÷ tan(sun elevation). The sun elevation comes from your location, date and time.

When are shadows shortest?

At solar noon, when the sun is highest. On any day, the shortest shadow is shown on the card, with its time.

Can I find the height of a tree or building?

Yes. Switch to "Height from shadow", enter the length of the shadow you measured, and set the time you measured it. The tool multiplies the shadow by the tangent of the sun's elevation.

Does it work on slopes?

The calculation assumes level ground. On a slope the shadow is shorter uphill and longer downhill.