Energy calculators

Sun Angle Calculator

Updated Jul 25, 2026 By Jehan Wadia
Rate Formulas
Clock (local)
--:--:--
Location
Choose a city to auto-fill coordinates, or pick "Enter Manually".
Latitude (North +, South −)
Degrees
Min
Sec
Tip: to enter decimal degrees, put it in "Degrees" and leave Min/Sec blank.
Latitude must be between −90° and +90°.
Longitude (East +, West −)
Degrees
Min
Sec
Longitude must be between −180° and +180°.
Date & Time
Please enter a valid calendar date.
JanFebMarAprMayJunJulAugSepOctNovDec

Drag to change the time. Track colors show night, twilight and daylight phases.
Night Astro. twilight Nautical Civil Daylight
Mode Inputs
Sun Position uses the Location and Date & Time above. No extra inputs needed.
Sun Path Visualizer

Elevation
Azimuth
Declin.
Hour ∠
Compass Rose — Solar Azimuth

Results

Sun Position

Solar Elevation
Solar Azimuth (from N, CW)
Solar Zenith Angle
cos(Zenith)
Solar Declination
Hour Angle
Equation of Time
True Solar Time
Clock Time
Earth–Sun Distance
Dawn (civil)
Sunrise
Solar Noon
Sunset
Dusk (civil)
Daylight Duration
March Equinox
June Solstice
September Equinox
December Solstice

Shadow Length

Shadow Length

Step-by-Step Solution


Introduction

The sun moves across the sky in a path that changes with your location, the date, and the time of day. Knowing where the sun is — how high it sits above the horizon and which direction it faces — matters for solar panel setup, building design, photography, gardening, and more. This Sun Angle Calculator lets you find the sun's exact position from any place on Earth at any time you choose.

Enter your location and a date, and the tool will calculate solar elevation, azimuth, zenith angle, solar declination, hour angle, and the equation of time. It also shows sunrise, sunset, solar noon, and daylight hours. You can check the angle of sunlight hitting a tilted surface like a solar panel, look up when the sun will match a target angle, and estimate clear-sky solar irradiance and air mass. A live mode tracks the sun in real time, and the sun path diagram and compass rose update as you adjust inputs.

All results include step-by-step math so you can follow each calculation. Whether you are sizing a solar energy system with our Solar Panel Calculator, planning shade structures, or just curious about the sun's path, this calculator gives you the data you need in seconds.

How to Use Our Sun Angle Calculator

Enter your location, date, and time below to calculate the sun's position in the sky. The calculator returns the solar elevation, azimuth, zenith angle, declination, hour angle, sunrise and sunset times, shadow length, and more.

Preset City: Pick a city from the dropdown list to auto-fill the latitude, longitude, and UTC offset. Choose "Enter Manually" if your location is not listed.

Latitude: Enter how far north or south your location is. Type the value in the Degrees box as a decimal number, or split it across Degrees, Minutes, and Seconds. Use the dropdown to select N for north or S for south. Valid range is 0° to 90°.

Longitude: Enter how far east or west your location is. Type the value in the Degrees box as a decimal number, or split it across Degrees, Minutes, and Seconds. Use the dropdown to select E for east or W for west. Valid range is 0° to 180°.

UTC Offset: Enter the number of hours your time zone is ahead of or behind UTC. For example, New York is −5 and London is 0. If you are unsure about your offset, our Time Zone Calculator can help you find it.

Daylight Saving: Select "Yes (+1h)" if daylight saving time is active at your location. Select "No" if it is not.

GPS Button: Click the GPS button to detect your current location automatically using your device. The latitude, longitude, and UTC offset will fill in for you.

Month, Day, and Year: Choose the month from the dropdown, then type the day and year. You can also drag the date scrubber slider to scroll through the days of the year, or use the − and + buttons to step one day at a time.

Hour, Minute, and Second: Enter the time of day you want to calculate. Use the Format dropdown to switch between 24-hour, AM, and PM formats. You can also drag the time-of-day slider to change the time quickly. The slider background shows night, twilight, and daylight phases in color.

Calculation Mode: Click a tab at the top to switch between six modes. "Sun Position" gives you the full sun position at your chosen time. "Solar Noon" finds the exact clock time when the sun is highest. "Incident Angle" calculates the angle sunlight hits a tilted surface like a solar panel. "Hour Angle" converts clock time to solar hour angle. "Declination" looks up the sun's north-south tilt for any day of the year. "Reverse Lookup" searches for dates and times when the sun matches a target altitude and azimuth.

Surface Tilt and Surface Azimuth (Incident Angle mode): Enter the tilt angle of your surface in degrees from horizontal, and the direction it faces. A surface azimuth of 0° means it faces due south. If you are mounting panels on a roof, our Roof Pitch Calculator can help you convert roof pitch to a tilt angle in degrees.

Standard Meridian (Hour Angle mode): Enter the reference meridian for your time zone in degrees. This is usually 15° multiplied by your UTC offset.

Target Altitude and Azimuth (Reverse Lookup mode): Enter the sun elevation and compass direction you want to find. Choose how many months to search. The calculator will list every date and time that matches.

Object Height (Shadow Length): In Sun Position mode, enter the height of an object and choose a unit to see how long its shadow will be at the selected time. A diagram below shows the shadow direction.

Calculate Button: Click "Calculate" to run the calculation and update all results. You can also click "Try Example" to load a sample setup, "Snap to Now" to use the current date and time, or "Go Live" to update results every second in real time.

Print Snapshot and Print Full Day: Click "Print Snapshot" to print the current results. Click "Print Full Day" to print a table of sun angles for every 15 minutes of the selected day.

What Is a Sun Angle Calculator?

A sun angle calculator finds the exact position of the sun in the sky for any place, date, and time. It tells you two key angles: solar elevation (how high the sun is above the horizon) and solar azimuth (the compass direction the sun is shining from). These two numbers together pinpoint where the sun sits in the sky at any moment. For a deeper look at general angle math, see our Angle Calculator.

Why Sun Angles Matter

The sun does not follow the same path every day. In summer, it climbs high and stays up longer. In winter, it stays low and sets early. The sun's path also changes based on where you are on Earth. A city near the equator sees the sun almost straight overhead, while a city far north or south never sees it that high. Knowing these angles helps people in many fields make better choices.

Solar panels work best when they face the sun directly. If you know the sun's angle, you can tilt your panels to capture the most light and make the most electricity. Even a few degrees of tilt adjustment can boost energy output throughout the year. Use these sun angle results alongside our Solar Calculator to estimate how much energy your system can produce, and check our Electricity Cost Calculator to see how that translates into savings on your power bill.

Architects and builders use sun angles to design windows, overhangs, and shading. A well-placed overhang can block harsh summer sun but let warm winter light inside. This saves energy on cooling and heating — you can quantify potential thermal losses with our Heat Loss Calculator or size climate control equipment with the BTU Calculator.

Photographers and filmmakers plan shoots around the sun's position. The angle of sunlight changes how shadows fall, which affects the look and mood of every shot. Golden hour — when the sun is low — is a favorite because the light is soft and warm.

Key Terms to Know

Solar elevation is the angle between the sun and the horizon. At sunrise and sunset, it is near 0°. When the sun is directly overhead, it is 90°. A negative value means the sun is below the horizon.

Solar azimuth is the compass direction of the sun, measured in degrees from north going clockwise. For example, 90° is east, 180° is south, and 270° is west.

Solar declination is the tilt of Earth relative to the sun. It changes slowly through the year and is the reason we have seasons. It swings between about +23.45° in June and −23.45° in December.

Hour angle tracks how far the sun has moved from solar noon. It is negative in the morning and positive in the afternoon. Each hour equals 15° of movement.

Equation of Time is a small correction that accounts for Earth's tilted axis and its slightly oval orbit. It explains why clock noon and solar noon rarely match up exactly. This difference can be as large as about 16 minutes. You can explore time offsets further with our Time Difference Calculator.

How Sun Position Is Calculated

The math starts with the day of the year and your latitude and longitude. First, the solar declination is found using the day of year. Next, the Equation of Time corrects for orbital quirks. These values combine with your clock time to find the local solar time and the hour angle. Finally, standard trigonometry formulas use the hour angle, declination, and your latitude to solve for the sun's elevation and azimuth.

The same math can also find sunrise, sunset, solar noon, twilight times, and daylight duration for any location on any date. The shadow length calculation uses the elevation angle and object height to form a right triangle, where the shadow is the base and the object is the vertical side. If you need to determine the area of your roof before installing solar panels, our Roof Area Calculator pairs well with the incident angle results from this tool. You can also explore how reducing grid electricity use lowers your environmental impact with our Carbon Footprint Calculator.


Formulas used

Solar Declination
\delta = 23.45^\circ \sin\!\left(\frac{360^\circ}{365}(n - 81)\right)
Equation of Time
EoT = 9.87\sin(2B) - 7.53\cos(B) - 1.5\sin(B), \quad B = \frac{360^\circ}{365}(n - 81)
Solar Elevation Angle
\sin \alpha = \sin \varphi \sin \delta + \cos \varphi \cos \delta \cos H
Solar Azimuth
\cos Az = \frac{\sin \delta - \sin \varphi \sin \alpha}{\cos \varphi \cos \alpha}
Hour Angle
H = 15^\circ \left( t_{\text{clock}} + \frac{4(\lambda - 15 \cdot UTC) + EoT}{60} - 12 \right)
Incident Angle on Tilted Surface
\cos \theta = \sin \alpha \cos \beta + \cos \alpha \sin \beta \cos(Az_s - \gamma)
Shadow Length
S = \frac{h}{\tan \alpha}
Air Mass (Kasten–Young)
AM = \frac{1}{\cos z + 0.50572\,(96.07995 - z)^{-1.6364}}

Frequently asked questions

What is solar elevation?

Solar elevation is the angle between the sun and the horizon. It is 0° at sunrise and sunset, and up to 90° if the sun is directly overhead. A negative number means the sun is below the horizon.

What is solar azimuth?

Solar azimuth is the compass direction of the sun measured in degrees from north, going clockwise. East is 90°, south is 180°, and west is 270°.

How do I enter my location?

Pick a city from the Preset City dropdown to auto-fill your coordinates. If your city is not listed, choose "Enter Manually" and type your latitude and longitude. You can also click the GPS button to detect your location from your device.

What is the difference between decimal degrees and degrees-minutes-seconds?

Decimal degrees use a single number like 40.7128°. Degrees-minutes-seconds (DMS) split that into whole degrees, minutes, and seconds, like 40° 42′ 46″. You can use either format in this calculator. To use decimal degrees, put the number in the Degrees box and leave Minutes and Seconds blank.

What UTC offset should I use?

The UTC offset is how many hours your time zone is ahead of or behind Coordinated Universal Time. For example, New York is −5, Chicago is −6, Denver is −7, Los Angeles is −8, and London is 0. If you are not sure, check your device clock settings or use the GPS button.

When should I turn on Daylight Saving?

Set Daylight Saving to Yes (+1h) if your clocks have "sprung forward" for summer. Set it to No during standard time in winter or if your area does not use daylight saving time at all.

What does the Live mode do?

Live mode updates the sun position every second using your current date and time. Click Go Live to start it and click Stop Live to pause. It is useful for watching the sun move in real time on the sun path diagram.

What is the Equation of Time?

The Equation of Time is a small correction, up to about 16 minutes, that accounts for Earth's tilted axis and its slightly oval orbit. It explains why solar noon (when the sun is highest) almost never matches exactly 12:00 on your clock.

What is the Incident Angle mode used for?

Incident Angle mode calculates the angle at which sunlight hits a tilted surface like a solar panel or a roof. A smaller incident angle means the surface catches more sunlight. Enter the surface tilt and the direction it faces to get the result.

What surface azimuth should I use for a south-facing solar panel?

Use for a surface that faces due south. The calculator defines surface azimuth as 0° = south, negative values toward east, and positive values toward west. In the Southern Hemisphere, north-facing panels should use 180°.

How does the shadow length calculation work?

The calculator uses the sun's elevation angle and the height of your object to form a right triangle. Shadow length equals the object height divided by the tangent of the elevation angle. If the sun is below the horizon, there is no shadow.

What does Reverse Lookup do?

Reverse Lookup finds the dates and times when the sun matches a target elevation and azimuth you set. It is helpful for planning photography shoots, figuring out when sunlight enters a window, or scheduling outdoor events around specific lighting conditions.

What is solar declination?

Solar declination is how far north or south the sun is relative to Earth's equator. It changes through the year, reaching about +23.45° around June 21 and −23.45° around December 21. This tilt is the main reason we have seasons.

What is the hour angle?

The hour angle measures how far the sun has moved from solar noon. It is 0° at solar noon, negative in the morning, and positive in the afternoon. Each hour of time equals 15° of hour angle.

What is solar noon?

Solar noon is the moment when the sun reaches its highest point in the sky for the day. It is not always at 12:00 on your clock because of your longitude within your time zone and the Equation of Time correction.

How accurate is this calculator?

This calculator uses standard solar position formulas that are accurate to within about 0.5° for dates between 1900 and 2200. For most practical uses — solar panels, architecture, photography, gardening — this level of accuracy is more than enough.

Can I use this calculator for locations in the Southern Hemisphere?

Yes. Enter your latitude with the hemisphere set to S (south). The calculator handles both hemispheres. The sun path diagram and all results will adjust for your location.

Why does the sun path change throughout the year?

Earth's axis is tilted about 23.45° relative to its orbit around the sun. This tilt causes the sun's path across the sky to shift higher in summer and lower in winter. Near the equator the change is small; near the poles it is dramatic.

What do the colors on the time slider mean?

The colors show the phases of the day. Dark blue is night, medium blue is astronomical twilight, light blue is nautical twilight, orange is civil twilight, and yellow is full daylight. They update based on your location and date.

What is air mass and why does it matter for solar energy?

Air mass (AM) describes how much atmosphere sunlight passes through to reach you. When the sun is directly overhead, AM is 1. When it is near the horizon, AM is much higher. More air mass means more light is absorbed and scattered, so solar panels receive less energy when the sun is low.

What is the best angle for solar panels?

A common rule of thumb is to tilt panels at an angle close to your latitude. For example, at 35° latitude, try a 35° tilt facing south (in the Northern Hemisphere). Use the Incident Angle mode in this calculator to fine-tune the tilt for different times of year.

What does the zenith angle mean?

The zenith angle is the angle between the sun and the point directly above you. It equals 90° minus the solar elevation. When the sun is on the horizon the zenith angle is 90°, and when it is directly overhead it is 0°.

Can this calculator show polar day or polar night?

Yes. At high latitudes near the poles, the sun may stay above the horizon all day (polar day or midnight sun) or never rise at all (polar night). The calculator will display "Polar day" or "Polar night" for sunrise and sunset when these conditions occur.

How do I print my results?

Click Print Snapshot to print the current results for your chosen time. Click Print Full Day to print a table showing sun angles every 15 minutes for the entire selected day. Both open a printer-friendly page.

What is the sun path diagram showing?

The sun path diagram plots the sun's arc across the sky from east to west. The solid line is today's path. The dashed orange line shows the June solstice path (highest arc), and the dashed blue line shows the December solstice path (lowest arc). The colored dot marks the sun's current position.

Does this calculator account for refraction?

The sunrise and sunset times use a standard correction of −0.833° to account for atmospheric refraction, which bends sunlight and makes the sun appear slightly above the horizon even after it has geometrically set. The elevation and azimuth outputs use the geometric position without refraction adjustment.

What is the Standard Meridian in Hour Angle mode?

The standard meridian is the reference longitude for your time zone. It is usually 15° multiplied by your UTC offset. For example, the US Eastern time zone (UTC −5) uses −75° as its standard meridian.

What is the compass rose showing?

The compass rose shows the sun's azimuth as a pointer on a circle marked with North, East, South, and West. It gives you a quick visual of which compass direction the sun is in at the selected time.