InputTestHub

Sun Position Calculator

Gives the sun altitude and azimuth at any instant from any place, with the refraction correction, shadow length and compass direction.

Calculators Nothing uploaded No sign-up Free, unlimited
Calculators tool
YYYY-MM-DD.
HH:MM, in the UTC offset below.
Positive north, negative south.
Positive east, negative west.
The offset in force on that date. Daylight saving is not applied for you.
Optional. Height lowers the horizon and moves sunrise earlier.
Enter your figures and press Calculate.
In short The sun position at any moment is two numbers: altitude, how high above the horizon it is, and azimuth, which compass direction it is in. Both come from your latitude, the sun declination on that date, and the local hour angle — how far past your meridian the sun has travelled, at 15 degrees per hour. Azimuth here is measured clockwise from TRUE north, which is not what a compass shows; a magnetic compass is offset by your local declination, and near metal, speakers or a car a phone magnetometer can be several degrees out on top of that. Two details make the difference between an approximate answer and a usable one. The first is refraction: the atmosphere bends light, so the sun appears higher than it geometrically is, by an amount that is negligible overhead and reaches about half a degree at the horizon. That correction is applied here, and it is the reason the sun is still visible after it has technically set. The second is that hour angle is measured from SOLAR noon, not clock noon, and the two differ by the equation of time plus your offset from the centre of your time zone. Shadow length follows directly from altitude: a vertical object casts a shadow equal to its height divided by the tangent of the sun altitude, so at 45 degrees the shadow equals the height, at 63 degrees it is half, and as the sun approaches the horizon it grows without limit.

How to use the Sun Position Calculator

  1. Enter the date and the local time.
  2. Enter your coordinates and the UTC offset in force.
  3. Read the altitude, azimuth and shadow length.

About the Sun Position Calculator

Solar altitude and azimuth at a chosen instant, with refraction, shadow length and the compass bearing.

What people use it for

  • Working out whether a window or a garden will be in sun at a given hour.
  • Planning solar panel angles or shading.
  • Finding the shadow length a building will cast.

Details

Altitudedegrees above the horizon, refraction applied
Azimuthdegrees clockwise from TRUE north, not magnetic
The sun moves15° of hour angle per hour
Refraction at the horizonabout 0.5°, and near zero overhead
Shadow at 45° altitudeequal to the object height
London, 21 June, 13:00about 62° up, almost due south
PrivacyEverything runs in your browser. No location lookup, nothing sent anywhere
Altitude is given both refracted, which is what you see, and geometric, which is where the sun actually is. The gap is negligible overhead and about half a degree at the horizon.

Where this tool stops

Every time here is computed from your latitude, longitude and the UTC offset you enter — nothing is looked up and no location is guessed. Daylight saving is NOT applied: enter the offset that is actually in force on the date you are asking about, or add the hour yourself. Times assume a flat sea-level horizon, so hills, buildings and trees will move sunrise and sunset by minutes. This is astronomy, not weather: it tells you where the sun and moon are, never whether you will be able to see them.

Frequently asked questions

What is solar altitude and azimuth?
Altitude is how many degrees the sun is above the horizon; azimuth is its compass bearing measured clockwise from true north. Together they say exactly where in the sky to look.
Is azimuth measured from true or magnetic north?
True north. A compass points at magnetic north, which differs by your local magnetic declination — sometimes by more than ten degrees. Correct for it before using this bearing with a compass.
How do I calculate shadow length?
Divide the object height by the tangent of the sun altitude. At 45 degrees the shadow equals the height; at 63 degrees it is about half; near the horizon it becomes very long very quickly.
Why does the tool apply refraction?
Because the atmosphere bends light and makes the sun look higher than it is, by about half a degree near the horizon. Without that correction the sun would appear to set several minutes before it visibly does.
What is the hour angle?
How far the sun has moved past your meridian, at 15 degrees per hour, measured from SOLAR noon rather than clock noon. Negative means before noon.
Can I use this for solar panels?
For working out sun angles and shading through the day, yes. It gives geometry, not irradiance — cloud, haze and air mass all affect how much energy actually arrives.
Do I need an account to use the Sun Position Calculator?
There is no cost and no cap. The Sun Position Calculator is not a demo of a paid product, so nothing is held back or watermarked.
Is the Sun Position Calculator safe to use with private information?
No. The Sun Position Calculator runs entirely in your browser using JavaScript. Your input never reaches inputtesthub.com or any third party — open your browser's Network tab while you use it and you will see no request go out.
Who is the Sun Position Calculator for?
Typical uses: working out whether a window or a garden will be in sun at a given hour. Planning solar panel angles or shading. Finding the shadow length a building will cast. It is built for exactly those cases rather than being a general-purpose tool with this bolted on.
When is the Sun Position Calculator not the right tool?
Every time here is computed from your latitude, longitude and the UTC offset you enter — nothing is looked up and no location is guessed. Daylight saving is NOT applied: enter the offset that is actually in force on the date you are asking about, or add the hour yourself. Times assume a flat sea-level horizon, so hills, buildings and trees will move sunrise and sunset by minutes. This is astronomy, not weather: it tells you where the sun and moon are, never whether you will be able to see them. Knowing where a tool stops being trustworthy matters more than the cases where it works.
Which values should I know?
Altitude is degrees above the horizon, refraction applied. Azimuth is degrees clockwise from TRUE north, not magnetic. The sun moves is 15° of hour angle per hour. These are printed on the page itself, so you do not have to take them on trust.
Can I rely on this for exact work?
The calculation runs in double precision and the result is shown to ten significant figures, so converting a value and converting it back returns the original. What is displayed is rounded for readability; what is copied is not.

Related calculators tools

All 382
01

Loan Calculator

Works out the monthly payment, total interest and full repayment schedule for any loan from…

02

EMI Calculator

Calculates your Equated Monthly Instalment with a full principal-versus-interest breakdown and…

03

Mortgage Calculator

Estimates a full monthly housing payment including principal, interest, property tax…

04

Car Loan Calculator

Calculates a car finance payment from the price, deposit, trade-in, interest rate and term…

05

Personal Loan Calculator

Works out instalments and total cost for an unsecured personal loan, including any processing…

09

SIP Calculator

Projects the maturity value of a monthly Systematic Investment Plan, showing invested amount…