Energy calculators

Sun Angle Calculator

Updated Nov 17, 2026 By Infinity Calculator Formulas Sources
Rate
Clock (local)
--:--:--
Location
Choose a city to auto-fill coordinates, or pick "Enter Manually".
    Time zone: America/New_York. The UTC offset and daylight saving below follow the chosen date.
    Place data adapted from GeoNames (CC BY 4.0).
    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 position from any place on Earth, at any time of day, on any date from 1900 to 2200.

    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. This calculator gives you the data you need for sizing a solar energy system with our Solar Panel Calculator, planning shade structures, or simply following the sun's path.

    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, or search for any city or town in the box below it, to fill in the latitude, longitude, UTC offset, and daylight saving for the date you choose. Choose "Enter Manually" to type a location yourself.

    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.

    Daylight Saving: When you pick or search a city, this is set for you from that place's rules on the date you choose. For a location you type yourself, select "Yes (+1h)" if daylight saving time is active there and "No" if it is not.

    GPS Button: Click the GPS button to detect your current location automatically using your device. The latitude, longitude, UTC offset, and daylight saving 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 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 how far north or south of the equator the sun is on the day of the year you choose. "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.

    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 finds the closest matching time on each day, lists up to 60 of those days, and gives the total number found above the table.

    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 "Snap to Now" to use the current date and time, or "Go Live" to update results every second in real time.

    What Is a Sun Angle Calculator?

    A sun angle calculator finds the 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.

    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.

    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.

    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.8 For example, 90° is east, 180° is south, and 270° is west.8

    Solar declination is the angle between Earth's equator and a line from the center of Earth to the center of the sun, which tells you how far north or south of the equator the sun is.1 Declination changes through the year because Earth's axis is tilted.1 That same tilt gives us our seasons.7 The declination reaches a maximum of 23.45° around June 22 and a minimum of −23.45° around December 21–22.1

    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.2

    Equation of Time is a small correction, in minutes, for the eccentricity of Earth's orbit and Earth's axial tilt.2 It is one reason clock noon and solar noon rarely match up exactly. The Equation of Time alone can reach about 16 minutes.7 Your position east or west within your time zone also moves solar noon on the clock, and so does daylight saving time.7

    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.1 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.2 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.


    Formulas used

    Solar Declination 1
    \delta = 23.45^\circ \sin\!\left(\frac{360^\circ}{365}(n - 81)\right)
    Equation of Time 2
    EoT = 9.87\sin(2B) - 7.53\cos(B) - 1.5\sin(B), \quad B = \frac{360^\circ}{365}(n - 81)
    Solar Elevation Angle 3
    \sin \alpha = \sin \varphi \sin \delta + \cos \varphi \cos \delta \cos H
    Solar Azimuth 8
    Az = \cos^{-1}\!\left[\frac{\sin \delta \cos \varphi - \cos \delta \sin \varphi \cos H}{\cos \alpha}\right], \quad Az \to 360^\circ - Az \text{ when } H > 0
    Hour Angle 2
    H = 15^\circ \left( t_{\text{std}} + \frac{4(\lambda - 15 \cdot UTC) + EoT}{60} - 12 \right), \quad t_{\text{std}} = t_{\text{clock}} - 1\text{ h during daylight saving}
    Incident Angle on Tilted Surface 5
    \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) 4
    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 about 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.8 East is 90°, south is 180°, and west is 270°.8

    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. Picking or searching a city fills it in for you, and so does the GPS button.

    When should I turn on Daylight Saving?

    When you pick or search a city, Daylight Saving is set for you from that place's rules on the date you choose. For a location you enter yourself, set it 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 is the Equation of Time?

    The Equation of Time is a correction, in minutes, for the eccentricity of Earth's orbit and Earth's axial tilt.2 It can reach about 16 minutes.7 It is one reason solar noon (when the sun is highest) almost never falls at exactly 12:00 on your clock. Your longitude within your time zone and daylight saving time are the others.7

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

    Use 0° 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 do you calculate shadow length from the sun's elevation angle?

    The sun's elevation angle and the height of the object 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 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 a maximum of 23.45° around June 22 and a minimum of −23.45° around December 21–22.1 The change comes from the tilt of Earth's axis.1 That tilt is also the reason we have seasons.7

    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.2 Each hour of time equals 15° of hour angle.2

    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, daylight saving time, and the Equation of Time correction.2

    Why does the sun path change throughout the year?

    Earth's axis is tilted about 23.45° relative to its orbit around the sun.1 This tilt causes the sun's path across the sky to shift higher in summer and lower in winter.

    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.4 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?

    For the highest yearly output, panels in the Northern Hemisphere are pointed due south and tilted at an angle equal to the local latitude.6 For example, at 35° latitude, try a 35° tilt facing south. 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°.

    What is the standard meridian of a time zone?

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


    Sources

    1. Honsberg C, Bowden S. Declination Angle. PVEducation. Photovoltaics Education Website, ch. 2.4. Accessed September 29, 2026.
    2. Honsberg C, Bowden S. Solar Time. PVEducation. LSTM; Equation of Time; Time Correction Factor; Hour Angle. Accessed September 29, 2026.
    3. Honsberg C, Bowden S. Elevation Angle. PVEducation. Accessed September 29, 2026.
    4. Honsberg C, Bowden S. Air Mass. PVEducation. Accessed September 29, 2026.
    5. Honsberg C, Bowden S. Arbitrary Orientation and Tilt. PVEducation. Accessed September 29, 2026.
    6. Solar Photovoltaic System Design Basics. U.S. Department of Energy, Solar Energy Technologies Office. Mounting Structures. Accessed September 29, 2026.
    7. The Equation of Time. U.S. Naval Observatory. Apparent and Mean Solar Time. Accessed October 7, 2026.
    8. Honsberg C, Bowden S. Azimuth Angle. PVEducation. Photovoltaics Education Website, ch. 2.4. Accessed November 17, 2026.