Solar azimuth calculator
Knowing where the Sun sits in the sky is the basis of solar panel aiming, shadow studies, daylighting and navigation. This calculator finds the Sun's position from three astronomical inputs: your latitude, the solar declination (the latitude where the Sun is directly overhead that day, which ranges from about plus to minus 23.44 degrees through the year), and the hour angle (how far the Sun is from the local meridian, zero at solar noon and gaining 15 degrees for every hour, positive in the afternoon). From these it computes two angles. The elevation is the height of the Sun above the horizon, found from the standard relation involving the sines and cosines of latitude, declination and hour angle. The azimuth is the compass bearing of the Sun, measured clockwise from due south or north depending on convention, derived once the elevation is known. Together they pin the Sun to a point on the sky dome. Enter your own latitude, declination and hour angle to plan a solar installation, study a shadow or check an exercise. Every figure here is computed deterministically from the standard solar position equations, shown in full below with a worked example that reconciles exactly to the calculator so you can follow each step.
Elevation comes from sin(el) = sin(lat) sin(dec) + cos(lat) cos(dec) cos(H), then azimuth from the elevation. At latitude 40 degrees, declination 20 degrees and hour angle 45 degrees (mid afternoon), the Sun's elevation is 46.79 degrees and its azimuth is 256.05 degrees.
Solar position equations
sin(elevation) = sin(lat) sin(dec) + cos(lat) cos(dec) cos(H)
cos(azimuth) = ( sin(dec) - sin(el) sin(lat) ) / ( cos(el) cos(lat) )
azimuth measured clockwise from north; if H > 0, azimuth = 360 - azimuth
lat = latitude, dec = solar declination, H = hour angle
The elevation equation combines latitude, declination and hour angle to lift the Sun above the horizon. Once the elevation is known, the azimuth equation gives the compass bearing, with the afternoon (positive hour angle) reflected to the western half of the sky.
Worked example
Find the Sun's position at latitude 40 degrees, declination 20 degrees and an hour angle of 45 degrees (mid afternoon).
- sin(el) = sin40 sin20 + cos40 cos20 cos45 = 0.21985 + 0.50901 = 0.72885
- elevation = arcsin(0.72885) = 46.79 degrees
- cos(az) = (sin20 - sin(el) sin40) / (cos(el) cos40) = (0.34202 - 0.46850) / 0.52449 = -0.24115
- arccos(-0.24115) = 103.95 degrees; since H > 0, azimuth = 360 - 103.95 = 256.05
- So elevation is 46.79 degrees and azimuth is 256.05 degrees
The Sun's elevation is 46.79 degrees and its azimuth is 256.05 degrees (west of south, in the afternoon). These are the calculator's default inputs, so the results above match the widget exactly.
Solar azimuth calculator: frequently asked questions
What is solar azimuth?
Solar azimuth is the compass bearing of the Sun, the direction along the horizon toward the point directly below the Sun. Measured clockwise from north, it tells you whether the Sun is to the east, south or west. Together with elevation it fixes the Sun's position in the sky.
What is solar elevation?
Solar elevation, or altitude, is the angle of the Sun above the horizon, from 0 degrees at the horizon to 90 degrees straight overhead. It is highest at solar noon and zero at sunrise and sunset. It drives the length of shadows and the intensity of sunlight on a surface.
What is the hour angle?
The hour angle measures how far the Sun is from the local meridian in degrees, with zero at solar noon. It increases by 15 degrees for each hour, since the Earth turns 360 degrees in 24 hours, and is taken as negative in the morning and positive in the afternoon.
What is solar declination?
Solar declination is the latitude at which the Sun is directly overhead on a given day. It swings between about plus 23.44 degrees at the June solstice and minus 23.44 degrees at the December solstice, passing through zero at the equinoxes, because of the tilt of the Earth's axis.
Why is the azimuth reflected in the afternoon?
The azimuth equation using the inverse cosine returns an angle between 0 and 180 degrees, which is correct only for the morning. In the afternoon, when the hour angle is positive, the Sun is in the western half of the sky, so the calculator subtracts the result from 360 degrees. The computation is deterministic and reconciles exactly to the worked example.
Official sources
- Solar position and Earth observation reference data: US National Oceanic and Atmospheric Administration (NOAA). As at 25 June 2026.
Reviewed by the CalculatorHub team, edited by James Graham, 25 June 2026. See our methodology. This is general information, not financial, tax, legal or investment advice.