Physics & Chemistry
Sun Position Calculator (Solar Elevation and Azimuth)
Where the sun stands in the sky matters to photographers planning golden-hour shots, architects studying shadows and daylight, solar installers checking for shading, gardeners and pilots. Its position is described by two angles: the elevation, or altitude, which is the height of the sun above the horizon, and the azimuth, the compass direction measured clockwise from true north. Both depend on the latitude and longitude of the observer and on the exact time. This calculator uses the solar position algorithm published by the US National Oceanic and Atmospheric Administration, based on the equations in Jean Meeus's Astronomical Algorithms. It first finds the sun's apparent ecliptic longitude and the tilt of the Earth's axis for the given moment, which give the solar declination, the latitude on Earth where the sun is directly overhead, ranging from about 23.44 degrees north at the June solstice to 23.44 degrees south in December. It then works out the equation of time, the difference of up to about sixteen minutes between clock time and solar time caused by the Earth's elliptical orbit and tilted axis, and the hour angle, how far the sun has moved west of the local meridian. From these, simple spherical trigonometry gives the elevation and azimuth. Enter the date, the time in Coordinated Universal Time, and your latitude and longitude, and the calculator returns the elevation, the azimuth, whether the sun is up, the declination, the equation of time and the UTC time of solar noon.
How to use this calculator
- Choose the date.
- Enter the time in UTC; convert from local time by subtracting your time-zone offset.
- Enter your latitude, positive north of the equator.
- Enter your longitude, positive east of Greenwich and negative to the west.
- Read the sun's elevation and azimuth, and the time of solar noon.
Using the results
Photographers use the elevation to find golden hour, roughly when the sun is less than about 6 degrees above the horizon, and blue hour, when it is between about 4 and 6 degrees below.
Solar installers and architects use the azimuth and elevation at several times of day and year to check whether trees or buildings will shade panels or windows, often plotting them as a sun-path diagram.
Accuracy and refraction
The NOAA algorithm is accurate to a small fraction of a degree for dates within a few centuries of today, which is more than enough for planning and design.
Near the horizon the atmosphere bends sunlight, lifting the visible sun by about 0.5 degrees. Sunrise and sunset calculators include this effect, while this calculator gives the true geometric position.
Formula & method
NOAA solar position algorithm (after Meeus, Astronomical Algorithms)Elevation = 90° − zenith; cos(zenith) = sin φ sin δ + cos φ cos δ cos HHour angle H = true solar time ÷ 4 − 180°; true solar time = UTC + equation of time + 4 × longitudeAzimuth measured clockwise from true north; no atmospheric refraction appliedNOAA algorithm: declination and equation of time from Meeus's solar formulas, then cos(zenith) = sin φ sin δ + cos φ cos δ cos H and elevation = 90° − zenith.
Worked example
London (51.5° N, 0°) at 12:00 UTC on 21 June 2024
- Solar declination ≈ +23.44°
- Equation of time ≈ −1.9 min, so solar noon is at about 12:02 UTC
- Elevation ≈ 90 − 51.5 + 23.44 ≈ 61.9°, azimuth ≈ 179° (due south)
Answer: The sun stands about 62° above the southern horizon, its highest of the year.
Frequently asked questions
Why do I need to enter UTC?
The sun's position depends on absolute time, not on time zones or daylight saving. Using UTC avoids errors; for example, 9:00 in New York in summer (UTC−4) is 13:00 UTC.
Is the azimuth from true or magnetic north?
True north. To use a magnetic compass, add or subtract the local magnetic declination, which can be several degrees and changes over time.
What is the solar declination?
It is the latitude at which the sun is directly overhead at noon. It varies between about +23.44° in late June and −23.44° in late December, and is close to zero at the equinoxes.
What is the equation of time?
It is the difference between apparent solar time and mean clock time. It ranges from about −14 minutes in February to about +16 minutes in early November.
Why is solar noon not at 12:00?
Solar noon depends on your longitude within the time zone, on daylight saving time and on the equation of time. It can differ from 12:00 by an hour or more.
What does a negative elevation mean?
The sun is below the horizon. Between 0 and −6 degrees it is civil twilight, when there is still enough light for most outdoor activities.