Sun Position Calculator
Quick answer: Pick a date and click a place to see the sun's elevation above the horizon and its azimuth, plus sunrise and sunset for the same day.
How to use sun position calculator
- Find a place or enter latitude, longitude.
- Set the local date and time; use Back to now to resume live updates.
- Read the compass and elevation. The shadow example uses a one-metre object on level ground.
Worked example
- Input
- A vertical 10 m pole; solar elevation 45°; solar azimuth 180°
- Expected result
- Shadow length 10 m, pointing north at 0°.
Length = height ÷ tan(elevation). The shadow points 180° away from the Sun’s compass direction.
Calculation method and accuracy
Solar azimuth is measured clockwise from true north: north 0°, east 90°, south 180°, west 270°. Elevation is the geometric angle above the horizon. The compass is a direction diagram, not a device magnetometer. The same selected instant drives the compass, readout and day/night overlay.
Common mistakes and edge cases
- True north and magnetic north can differ. Do not transfer this bearing to a magnetic compass without accounting for declination.
- A negative elevation means the Sun is below the horizon; the daylight shadow formula does not apply.
- This estimates position, not solar-panel energy yield. Clouds, terrain, roof pitch and obstructions require a separate model.
Sources and verification
Reviewed by GeoDataViewer · . Examples are rounded; the interactive result uses your selected inputs.
Elevation and azimuth
Elevation is how high the sun is above the horizon, from 0° at sunrise to a maximum at solar noon. Azimuth is the compass direction it appears in, measured clockwise from north.
Together they give the sun's position in the sky completely, which is what you need for shadow length, panel orientation, or working out whether a window will be in direct sun at a given hour.
Shadow length follows from elevation
The shadow cast by an object of height h is h divided by the tangent of the solar elevation. At 45° the shadow equals the object's height; at 10° it is nearly six times as long. That is why shadows stretch so far in the hour after sunrise.
Practical uses
Solar panel siting, architectural daylighting, photography planning, and gardening all depend on where the sun will be. Landscape photographers use azimuth to check whether a subject will be lit from the side or face-on at a given time of year.
Limitations to keep in mind
This gives the geometric position of the sun on a spherical Earth with standard refraction applied only to the rise and set times. It does not model local horizon obstructions, which usually matter more than any of these corrections.
Related tools
- Sunrise and sunsetSunrise, sunset and day length for any date and place.
- Moon phase calendarPhase and illumination for any date.
- Moon positionWhere the moon is overhead right now.
- Day and night mapThe live day/night terminator.
- Time zone mapCompare local times around the world.
Frequently asked questions
- What is solar elevation?
- The angle of the sun above the horizon, in degrees. Zero means it is on the horizon and 90° would mean directly overhead, which only happens in the tropics.
- What is solar azimuth?
- The compass direction of the sun, measured clockwise from north. 90° is due east, 180° due south, and 270° due west.
- How do I work out shadow length?
- Divide the object's height by the tangent of the elevation angle. At 45° elevation, a 10 m pole casts a 10 m shadow.
- When is the sun highest?
- At solar noon, which is usually not 12:00 on the clock. The gap comes from your longitude within the timezone and from the equation of time.
- Does the sun ever pass directly overhead?
- Only between the Tropic of Cancer and the Tropic of Capricorn. Outside the tropics the sun always stays at least slightly to the south or north.
- Why is the elevation negative at night?
- Elevation is measured continuously, so below the horizon it becomes negative. A value of -18° or lower is astronomical night.
- Can I use this for solar panel planning?
- It is a good first approximation. For a full yield model you also need local weather, panel orientation, and shading from nearby objects.
- How accurate is the sun position?
- Within about a tenth of a degree, which is well inside what planning work needs.
- Why does the sun appear to move faster at some times of year?
- The Earth's orbit is elliptical, so its angular speed varies. The equation of time captures this and explains why solar noon drifts through the year.
- Does the tool account for refraction?
- The sunrise and sunset times do. The elevation figure is the geometric position, which is about half a degree below the apparent position near the horizon.