Coordinately

Sun Position

Compute solar azimuth, altitude, declination, equation of time, sunrise, sunset, solar noon, and civil/nautical/astronomical twilight for any coordinate and UTC instant. Meeus (1991) algorithm, accurate to ~0.01° — survey-grade for everyday use.

What sun position is

A point in the sky is named by two angles in the horizontal coordinate system: the azimuth (compass bearing of the object, 0–360° clockwise from true north) and the altitude (elevation angle above the horizon, 0° at the horizon, 90° straight up). Knowing where the sun sits in those two angles answers questions about shadow length, solar panel orientation, golden-hour photography, and how long the day will last.

Horizontal coordinate systemA horizon plot mapping the sky. The X-axis is compass azimuth from 0° North through East, South, and West back to 360° North. The Y-axis is altitude in degrees above the horizon. Three reference sun positions are plotted to anchor the system: a typical sunrise on the east horizon, high noon in Northern Hemisphere summer high in the southern sky, and a typical sunset on the west horizon.The horizontal coordinate system0°15°30°45°60°75°90°ALTITUDEAZIMUTH (clockwise from true north)N0°NE45°E90°SE135°S180°SW225°W270°NW315°N360°Sunrise (typical)(90°, 0°)High noon (NH summer)(180°, 60°)Sunset (typical)(270°, 0°)
The horizontal coordinate system. Azimuth is the compass bearing of the sun (0° = North, clockwise). Altitude is the angle above the horizon (0° at horizon, 90° at zenith). Three reference points are marked: a typical sunrise (east, on horizon), high noon in Northern Hemisphere summer (south, high altitude), and a typical sunset (west, on horizon).Standard horizontal (alt-az) coordinate system per Jean Meeus, "Astronomical Algorithms" (Willmann-Bell, 1991/1998).

The tool below computes solar azimuth and altitude for any point on Earth at any UTC instant. Behind the math is the Meeus (1991) algorithm, accurate to about 0.01° in azimuth and altitude — survey-grade for everyday use; for observatory-grade work use NREL's SPA algorithm instead.

Coordinate + UTC time → sun position

Two inputs: an observer coordinate, and the UTC instant. Use the buttons to fill from your location and the current time.

Try:

See the observer on the map

Click anywhere on the map to set a new observer coordinate — solar geometry and the sun-path arc re-render instantly.

How to use this tool

  1. Set the observer coordinate

    Decimal degrees, DMS, or DDM all work. The map below is clickable — clicking sets the observer. "Use my location" reads the browser geolocation API.

  2. Set the UTC date and time

    Use the datetime-local picker — the value is treated as UTC. "Use now" fills the current UTC instant. For solar-noon calculations, set the time to about (12 − longitude/15) hours UTC.

  3. Read the result

    Azimuth (compass bearing of the sun) and altitude (elevation above horizon) are the headline numbers. The deep report below the map adds the sun's path across the sky today, all twilight events, declination, equation of time, and one-click cross-links to the time-zone and magnetic-declination tools.

The horizontal coordinate system

Every observer's view of the sky has its own coordinate system, anchored to the local horizon. Two angles pin any celestial object:

Horizontal-coordinate quantities
QuantityRangeMeaning
Azimuth0° to 360°Compass bearing of the object, measured clockwise from true north. North = 0°, East = 90°, South = 180°, West = 270°.
Altitude (elevation)-90° to +90°Angle above the horizon. 0° at horizon, 90° at zenith (straight up), negative below horizon.
Zenith distance0° to 180°Complement of altitude: 90° − altitude. Some literature uses zenith distance instead of altitude.

"True north" matters here. The sun rises in the east and sets in the west on average, but its exact compass bearing on any given day depends on the season and your latitude. If you're comparing the tool's azimuth to a magnetic-compass reading in the field, apply magnetic declination first — see /tools/magnetic-declination for the local correction.

The astronomical quantities behind it

Azimuth and altitude are derived from three more fundamental astronomical numbers:

Underlying astronomical quantities
QuantityRangeWhat it represents
Solar declination (δ)-23.44° to +23.44°The sun's latitude on the celestial sphere. Tracks the seasons: +23.44° at June solstice, -23.44° at December solstice, 0° at the equinoxes.
Hour angle (H)-180° to +180°Angular distance of the sun west of the observer's meridian. 0° at solar noon, +180° at midnight. 1 hour = 15°.
Equation of time (EOT)-16 to +14 minutesSun's deviation from a perfect 24-hour clock, caused by Earth's elliptical orbit and axial tilt. November and February show the largest deviations.

How sunrise and sunset are computed

Sunrise and sunset are when the upper limb of the sun is at the horizon — not the geometric centre. Atmospheric refraction bends light so the apparent horizon-grazing position is at a geometric altitude of about -0.833°(the standard refraction at the horizon, 0.567°, plus half the sun's angular diameter, 0.266°). The tool solves the altitude equation for that threshold to get the rise and set times.

Altitude thresholds for solar events
EventAltitude thresholdNotes
Sunrise / sunset-0.833°Refraction (0.567°) + half solar disc (0.266°).
Civil twilight-6°Brightest stars become visible; outdoor activity needs artificial light below this.
Nautical twilight-12°Sea horizon distinguishable from sky — used historically for celestial navigation.
Astronomical twilight-18°Sky becomes fully dark; deep-sky astronomy starts.
Polar day / nightAlways above / always below 0°Above the Arctic Circle in summer or below the Antarctic Circle in winter, the sun never sets / rises.

Ten worked examples — sun at solar noon on the June solstice 2026

Solar position at local solar noon on 2026-06-21 (June solstice). Note: solar noon in UTC ≈ 12:00 − longitude/15. Azimuth at solar noon is ≈ 180° in the Northern Hemisphere and ≈ 0° (or 360°) in the Southern.
ObserverLatitudeAltitude at solar noon (approx.)Direction sun faces
North Pole90°N+23.44°No azimuth (sun circles)
Reykjavík64.15°N+49.29°Due south
London51.51°N+62.0°Due south
New York40.71°N+72.7°Due south
Tropic of Cancer23.44°N+90.0° (overhead)Sun at zenith
Equator+66.56°Due north (sun crosses to north of zenith)
Tropic of Capricorn23.44°S+43.13°Due north
Sydney33.87°S+32.69°Due north
Cape Town33.92°S+32.65°Due north
South Pole90°S-23.44° (below horizon)Polar night

The pattern: at the June solstice the sun is directly overhead at 23.44°N (the Tropic of Cancer), drops in altitude proportionally with the latitude difference, and is below the horizon at the South Pole. Six months later (December solstice) the pattern flips: overhead at 23.44°S, polar night at the North Pole.

Misconceptions worth getting straight

"The sun rises exactly in the east"

Only on the equinoxes (around March 20 and September 22). The rest of the year, sunrise is north of east in summer (Northern Hemisphere) and south of east in winter. The azimuth at sunrise can swing by 50–60° between solstices at mid-latitudes. Photographers planning a sunrise shoot need the date-specific azimuth, not the abstract "east".

"Solar noon is when the sun is highest"

Yes — that's the definition. But "the sun's highest point of the day" is also onlyat solar noon. The sun's altitude is highest along the meridian crossing; before and after the crossing it's lower. Photography apps that compute "golden hour" use the altitude curve to find when the sun is roughly 0–6° above the horizon.

"Day length is the same as time-between-sunrise-and-sunset"

Almost — that's exactly how the tool computes it. But two subtleties affect real-world day length: (a) terrain occlusion (a mountain east of you delays sunrise); (b) altitude above sea level (a higher observer sees sunrise earlier and sunset later than the lib's sea-level horizon calculation). For aviation or summit photography, bake in the elevation correction.

"The sun is exactly south at solar noon"

In the Northern Hemisphere at mid-latitudes, yes — approximately. But at the equator the sun crosses northof zenith from March 20 to September 22 and south of zenith the other half of the year. At the tropics the sun passes directly overhead twice a year. In the Southern Hemisphere it's north at solar noon for most of the year.

"Solar position is affected by atmospheric refraction"

Only near the horizon. The geometric sun position (the Meeus formula) computes where the sun would be in vacuum. Refraction adds ~0.567° at the horizon (i.e. the sun appears higher than it geometrically is), dropping to ~0.0° at the zenith. The tool builds refraction into sunrise/sunset times (using the -0.833° threshold) but reports geometric altitude for the "current sun" reading. For survey-grade alignment, apply the refraction correction yourself: refraction ≈ 0.0167° × tan(90° − altitude).

When to use this tool, when to upgrade

Use-case decision matrix
Use caseThis tool?Why
Photography golden-hour planningYesAzimuth + altitude at the planned shoot time. Accurate to 0.01°.
Solar panel orientationYesLookup at solar noon for the panel's latitude gives the optimal tilt angle.
Sunrise / sunset for travel planningYesStandard refraction included; accurate to about ±1 min.
Agricultural day-length trackingYesDay length and twilight events are derived directly.
Sundial / gnomon designYes — combined with sun-path arcThe arc shows the day-by-day sweep needed for the gnomon shadow geometry.
Survey-grade astrogeodetic workNo — use NREL SPASPA is the NREL Solar Position Algorithm, accurate to ±0.0003° over -2000 to +6000 CE. This tool is ±0.01°.
Long-historical reconstructions (BCE)NoBoth this tool and SPA assume modern Earth rotation parameters; pre-modern dates need ΔT corrections.

How to verify the result

  1. Sun-noon altitude check. Use the pocket formula: altitude = 90° − |latitude − declination|with declination from the report (or from a tabulated almanac). The tool's solar-noon altitude should match within ~0.01°.
  2. Day-length symmetry on equinoxes. On March 20 and September 22, day length at any latitude should be 12 hours ± a few minutes (refraction makes it a bit longer than 12 h). If the tool reports wildly different values, your input date is off.
  3. Compare against NOAA Solar Calculator. The NOAA online calculator (gml.noaa.gov/grad/solcalc/) is well-tested. Azimuth and altitude should match within ~0.02°; sunrise/sunset within ~1 min.

How this tool is built

Sun-position math lives in src/lib/coords/sun-position.ts — a from-scratch JavaScript implementation of the NOAA / Meeus simplified formulas. The whole computation runs in the browser; the observer coordinate and UTC time never leave the page. Twilight times re-use the same hour-angle math against the -6°, -12°, and -18° thresholds. The sun-path arc samples the algorithm every 15 min across the day to draw the track on the horizon plot in SunPathArc.tsx. Nearest-place and elevation in the deep report come from Mapbox v6 and USGS 3DEP via server-side proxies with Cache-Control: no-store.

Frequently asked questions

What are azimuth and altitude?

Azimuth is the compass bearing of the sun, measured clockwise from true north (0°=N, 90°=E, 180°=S, 270°=W). Altitude is the angle above the horizon, 0° at horizon, 90° at zenith (straight up). Together they pin the sun's position in the sky from the observer's perspective. Negative altitude means the sun is below the horizon.

Is the azimuth from true north or magnetic north?

True north. If you're comparing to a magnetic-compass reading in the field, apply your local magnetic declination first. The /tools/magnetic-declination tool computes the current local declination from WMM 2025 for any point.

How accurate is the algorithm?

About 0.01° in azimuth and altitude, ±1 minute in sunrise/sunset times. The math is the NOAA-published simplified solar formulas (derived from Meeus, "Astronomical Algorithms" 1991). For survey-grade observatory work, escalate to NREL's SPA algorithm (~0.0003° accuracy, -2000 to +6000 CE).

Why is the result computed in UTC?

Solar position is a function of an instant in time, not a local clock time. Civil time zones are political; UTC is the absolute reference. The tool computes in UTC and surfaces UTC times in the report. To convert to local clock time, use /tools/timezone-by-location with the same coordinate.

What are civil, nautical, and astronomical twilight?

Civil twilight: sun between 0° and -6° (still reading-light outdoors). Nautical twilight: sun -6° to -12° (sea horizon distinguishable; historic celestial-navigation regime). Astronomical twilight: sun -12° to -18° (sky still slightly bright; deep-sky astronomy waits until below -18°). The report's timetable includes all six events (dawn and dusk pairs for each twilight level).

Why is sunrise / sunset at -0.833° altitude, not 0°?

Two corrections. (1) Atmospheric refraction lifts the apparent horizon by about 0.567° (more if the air is cold). (2) Sunrise/sunset is when the upper limb of the sun (not the centre) crosses the horizon, adding another 0.266° (half the solar disc). Combined: -0.833° geometric altitude is the threshold. The tool uses this threshold; it's the international convention.

What is "polar day" / "polar night"?

Above the Arctic Circle (66.56°N) in summer, the sun never sets — polar day. Below the Antarctic Circle (66.56°S) in the same season, the sun never rises — polar night. Six months later the pattern flips. The tool detects these cases and labels the events as "polar (no event)" rather than returning nonsense times.

What is the equation of time?

The deviation between true solar time and mean solar time (clock time without time-zone offset). It ranges from -16 minutes (sun behind the clock in November) to +14 minutes (sun ahead of the clock in February), driven by Earth's elliptical orbit and axial tilt. It's why sundials don't agree with clocks even at the equator.

Sources

  1. Jean Meeus, Astronomical AlgorithmsJean Meeus, "Astronomical Algorithms" (Willmann-Bell, 1991, 1998 2nd ed). The canonical reference for the solar-position formulas this tool implements. · https://www.willbell.com/math/mc1.htm · Accessed .
  2. NOAA Global Monitoring Laboratory — Solar CalculatorNOAA GML Solar Position Calculator — published derivation of the simplified solar formulas (the Meeus-derived form this tool uses). · https://gml.noaa.gov/grad/solcalc/calcdetails.html · Accessed .
  3. NREL Solar Position Algorithm (SPA)NREL Solar Position Algorithm (Reda & Andreas, 2008). The survey-grade alternative — accurate to ±0.0003° over -2000 to +6000 CE. · https://midcdmz.nrel.gov/spa/ · Accessed .
  4. US Naval Observatory — Astronomical ApplicationsUSNO Astronomical Applications Department — the historical reference for sunrise/sunset and twilight definitions. · https://aa.usno.navy.mil/data/RS_OneDay · Accessed .
  5. IAU SOFAInternational Astronomical Union — Standards of Fundamental Astronomy. Defines the reference frames celestial coordinates use. · https://www.iausofa.org/ · Accessed .
  6. Twilight definitions — USNOUSNO definitions of civil, nautical, and astronomical twilight (sun -6°, -12°, -18°). The thresholds this tool uses. · https://aa.usno.navy.mil/faq/RST_defs · Accessed .
  7. Atmospheric refraction at the horizonSaemundsson (1986) refraction model — the source of the 0.567° horizon refraction term in the -0.833° sunrise/sunset threshold. · https://ui.adsabs.harvard.edu/abs/1986S%26T....72...70S/abstract · Accessed .
  8. ECMA-402 — Intl APIECMA-402 — ECMAScript Internationalization API. Defines the Intl.DateTimeFormat API used to format times in the report. · https://tc39.es/ecma402/ · Accessed .
  9. Mapbox Geocoding v6Mapbox Geocoding API v6 — used by the nearest-place lookup in the deep report. · https://docs.mapbox.com/api/search/geocoding-v6/ · Accessed .
  10. USGS 3DEPUSGS 3D Elevation Program — the source the deep report uses for US elevation lookups. · https://www.usgs.gov/3d-elevation-program · Accessed .