Sun Angle & Shadow Calculator

Calculate solar altitude, azimuth, and shadow length for any location and time

Calculate Sun Position

☀️ Daylight
--°
Solar Altitude
Height above horizon
--°
Solar Azimuth
Compass direction
--°
Zenith Angle
From directly overhead
--°
Hour Angle
Solar noon offset

Sun Position Visualization

90° 60° 30°
Azimuth: -- Direction: --

Shadow Length Calculator

Calculate how long a shadow will be cast by an object at the current sun angle.

=
--

Sun Data

Metric Value
Solar Declination --
Equation of Time --
True Solar Time --
Day of Year --

About This Sun Angle Calculator

The Sun Angle & Shadow Calculator is a free tool that computes the sun's position — altitude and azimuth — for any location, date, and time. It also calculates the shadow length cast by an object at that sun angle. All calculations run in your browser. No data is sent to any server.

The sun's position in the sky depends on three things: your latitude, the date (which sets the solar declination), and the time of day (which determines the hour angle). This calculator uses the standard astronomical formula:

sin(altitude) = sin(lat) × sin(dec) + cos(lat) × cos(dec) × cos(hour_angle)

  • Solar Altitude (Elevation): The angle of the sun above the horizon. 0° means the sun is on the horizon; 90° means directly overhead.
  • Solar Azimuth: The compass direction of the sun. 0° = North, 90° = East, 180° = South, 270° = West.
  • Shadow Length: Computed as object height ÷ tan(altitude). Shadows grow longer as the sun drops lower.

Worked Examples

Example 1: Shadow length at golden hour

A photographer in New York City (40.71°N) wants to know the shadow length of a 6-foot person during golden hour on March 20. At a solar altitude of 5°:

Shadow = 6 ft ÷ tan(5°) = 6 ÷ 0.0875 = 68.6 ft

That shadow is over 11 times the person's height — the long, dramatic shadows that photographers look for.

Example 2: Midday sun in summer

In Phoenix, AZ (33.45°N) on June 21 (summer solstice), the sun reaches about 80° altitude at solar noon. For the same 6-foot person:

Shadow = 6 ft ÷ tan(80°) = 6 ÷ 5.67 = 1.06 ft

The shadow is barely a foot long — the sun is nearly overhead.

Example 3: Solar panel tilt

In Chicago (41.88°N), the sun's noon altitude ranges from about 25° in December to 72° in June. A fixed solar panel tilt of about 42° (matching the latitude) is a good year-round compromise. For winter optimization, tilt to about 57° (latitude + 15°). For summer, tilt to about 27° (latitude - 15°).

Common Uses for Sun Angle Data

Photography

Plan golden hour shots and predict shadow direction and length for portraits and landscapes. Check the sun azimuth to know where the light will fall.

Gardening

Determine how many hours of direct sunlight a planting location receives. Check the sun angle across seasons to plan for shade from fences, trees, or buildings.

Solar Panels

Find the optimal tilt angle for panels at your latitude. Compare noon altitude in summer vs winter to decide between fixed or adjustable mounting.

Architecture

Design window placement, overhangs, and shading devices. Calculate whether a building will cast a shadow on neighboring properties at different times of year.

Sun Angle Reference

Altitude Range Lighting Condition Characteristics
Below -18° Astronomical Night Full darkness, stars visible
-18° to -12° Astronomical Twilight Sky not fully dark, faint glow on horizon
-12° to -6° Nautical Twilight Horizon visible at sea, some stars visible
-6° to 0° Civil Twilight Enough light for outdoor activities without artificial light
0° to 6° Golden Hour Warm, soft light ideal for photography. Long shadows.
6° to 60° Daylight Normal daylight conditions. Shadow length decreases as altitude increases.
60° to 90° High Sun Sun nearly overhead. Very short shadows. Occurs in tropics and mid-latitudes in summer.

Privacy & Limitations

All calculations run entirely in your browser using JavaScript. If you click "Use My Location," your device GPS provides the coordinates locally — they are not sent to any server. No inputs, coordinates, or results are stored or transmitted. When you close the page, everything is gone.

Accuracy: This calculator uses the simplified astronomical position formula. It is accurate to within about 1° for solar altitude and azimuth. It does not account for atmospheric refraction (which can shift apparent sun position by up to 0.5° near the horizon), local terrain, or obstructions. For professional solar engineering or navigation, use a dedicated ephemeris tool.

Frequently Asked Questions

What is solar altitude vs azimuth?

Solar altitude (elevation) is how high the sun appears above the horizon, measured in degrees. 0° means the sun is on the horizon; 90° means directly overhead. Solar azimuth is the compass direction toward the sun, measured clockwise from north: 0° = north, 90° = east, 180° = south, 270° = west.

How do I calculate shadow length from sun angle?

Shadow length = object height ÷ tan(solar altitude). For example, a 6-foot post at a 30° sun angle casts a shadow of 6 / tan(30°) = 10.4 feet. At 45°, the shadow equals the object height exactly. Below 1° altitude, shadows become extremely long (over 57 times the object height).

What is golden hour and when does it happen?

Golden hour is the period when the sun is between 0° and 6° above the horizon, producing warm, soft light with long shadows. It occurs shortly after sunrise and before sunset. The duration depends on latitude and season — about 20 minutes near the equator, and over an hour at higher latitudes in summer.

Why does the sun angle change throughout the year?

Earth's axis is tilted 23.45° relative to its orbital plane. This tilt causes the sun's declination to vary between +23.45° (summer solstice) and -23.45° (winter solstice), changing the maximum altitude the sun reaches at any given location.

What is the equation of time?

The equation of time is the difference between apparent solar time (the sun's real position) and mean solar time (clock time). It varies by up to ±16 minutes through the year because Earth's orbit is elliptical and its axis is tilted. This calculator applies the correction automatically.

How do I find the best tilt angle for solar panels?

A common starting point is to tilt panels at an angle equal to your latitude. For summer optimization, subtract 15°. For winter, add 15°. Use this calculator to check the sun's noon altitude at your location across different months and adjust accordingly.

What are civil, nautical, and astronomical twilight?

Civil twilight (sun 0°–6° below horizon): enough light for outdoor activities. Nautical twilight (6°–12° below): the horizon is visible at sea. Astronomical twilight (12°–18° below): the sky is not fully dark. Below -18° is full night.

How accurate is this sun angle calculator?

The calculator is accurate to within about 1° for both altitude and azimuth using standard solar position formulas. It does not account for atmospheric refraction (up to 0.5° near the horizon) or local terrain. For professional surveying or solar engineering, verify results with a dedicated solar ephemeris.

Is my location data sent to a server?

No. All calculations run in your browser using JavaScript. The geolocation button reads your coordinates locally from your device. No data — location, inputs, or results — is ever sent to a server or stored. When you close or refresh the page, everything is gone.

Can I use this calculator on my phone?

Yes. The tool is fully responsive and works on any device with a modern browser, including phones and tablets. The "Use My Location" button works with your phone's GPS.

Related Tools

Related Tools

View all tools
Request a New Tool
Improve This Tool