Sun Angle Calculator - Hour by Hour Solar Position and Shadow Lengths

Written by:
PK

Need precise sun angle data for a specific date and location? Our sun angle calculator provides hour-by-hour solar altitude and azimuth angles, plus shadow length calculations for any object height. Also, find an interactive visual mode that shows the sun's complete path across the sky and some detailed angle calculations.

Features of the sun angle calculator

The sun angle calculator only requires a location and a date/time entry to start (which you can autofill, if you like!), but it has a few customization options:

  • Hour-by-hour data: Complete 24-hour solar position table for any date. You can switch between 12h (AM/PM) and 24h time with the selector.
  • Visual solar analysis: Click Visual to see the sun's complete daily journey as an interactive arc diagram with real-time sun positioning (when viewing today's date), compass grid, and elevation markers.
  • Shadow calculations: Enter an object's height and the tool will return shadow lengths throughout the day. You can switch between feet & inches and meters with the dropdown. (For more detail, see the shadow length calculator)
  • Location search: Find cities worldwide, or enter latitude and longitude coordinates directly in the field. You can also use device location by hitting the GPS button.
  • Seasonal presets: Quickly hop to solstices and equinoxes
  • Date picker: Any date from past to future - perfect for seasonal comparisons
  • Export ready: Hit the Export CSV button to download the data as a CSV to load into another program. Or, hey, to stare at a CSV - your call.

When you change the Location field, hit the Go button (or hit enter or return) to recompute.

Understanding the data

For the header in Table mode, you can hover (tap on mobile) for a tooltip explaining the field or calculations. Here's a glossary of what you'll see:

  • Altitude is the sun's angle above the horizon (0° = horizon, 90° = directly overhead).
  • Azimuth shows compass direction (0° = North, 180° = South). Shadow length uses the simple formula: object height ÷ tan(altitude angle).
  • Shadow Length is the length of the shadow cast by the object you enter in the Height field.
  • Phase indicators show you visual sunrise/sunset/twilight classifications with emojis, per hour in the day.
  • Air Mass Factor indicates how much atmosphere sunlight travels through (lower numbers mean more direct light).
Table of sun angle over the course of a day in Boston

In Visual mode, the sun's current position appears as a colored dot: yellow for day, blue for twilight, gray for night. The diagram includes subtle grid lines for elevation angles and compass directions to help you understand exactly where the sun sits in the sky.

Sun angle over a day in Boston

Methodology and glossary

The Visual mode displays four key solar metrics in output cards:

  • Current Elevation - The sun's angle above the horizon in degrees (0° for the horizon up to 90° for directly overhead)
  • Zenith Angle - The angle from directly overhead to the sun's position (90° minus elevation)
  • Solar Noon Elevation - The maximum elevation the sun reaches on the selected date
  • Air Mass Factor - How much atmosphere sunlight travels through using the 1/cos(zenith angle) approximation (1.0 = sun directly overhead, higher numbers = more atmospheric filtering)

City data comes from the cities.json database, covering over 150,000 locations worldwide with latitudes and longitudes. The calculations use the SunCalc library for your location. Please verify all calculations manually, especially for critical applications.

... also, have fun with it! Stay sunny.

      

PK

PK started DQYDJ in 2009 to research and discuss finance and investing and help answer financial questions. He's expanded DQYDJ to build visualizations, calculators, and interactive tools.

PK lives in New Hampshire with his wife, kids, and dog.

Don't Quit Your Day Job...

DQYDJ may be compensated by our partners if you make purchases through links. See our disclosures page. As an Amazon Associate we earn from qualifying purchases.
Sign Up For Emails
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram