Compass check
Check your compass accuracy using the Sun
A compass can be off for three separate reasons: the magnetic declination where you are standing, something magnetic close to it, or the compass itself. The Sun is a reference none of them can touch. Its true bearing at any moment follows from the date, the time and your position, so one bearing taken along a shadow, on the Sun, at sunrise or sunset — or on Polaris after dark — shows how far off the compass reads. The calculator below does the astronomy, takes off the declination from the World Magnetic Model, and says whether what is left is more than the measurement itself can explain.
Check a compass against the sky
This is how to check whether a compass is accurate the way ships do it. Bowditch’s American Practical Navigator calls the sky the navigator’s only completely independent directional reference, because it is neither on Earth nor man-made, and the difference between a body’s observed and calculated bearing is, by definition, the compass error (§1500). The same check works on a hiking compass or a phone.
- Get clear of steel. Move well away from vehicles, fences, railings, reinforced concrete and power lines, and keep phones, keys and magnets away from the compass. The magnetic interference page shows how fast a stray field fades with distance.
- In daylight, use a shadow. Stand a straight stick upright — check it against a weight hung on a string — and take the bearing from its base to the tip of its shadow. A shadow points exactly away from the Sun.
- Do not look at the Sun, and never through a compass’s lens or prism. The “Sun itself” option is for instruments built to take its bearing, such as a ship’s azimuth circle; it gives the same answer as the shadow, turned through 180°.
- At sunrise or sunset take the bearing at the moment you pick below, over a level horizon — the sea, or open flat ground. The time does not matter; the calculator finds it.
- At night, north of the equator, take a bearing on Polaris.
- Note the time to the second if you can, and which time zone your clock is on.
No compass to hand? Leave the reading blank. The result still gives the Sun’s true and magnetic bearing for the moment you enter, and how far to turn from the Sun or a shadow to face true north.
What it assumes. The Sun’s position comes from the NOAA solar calculator’s equations (after Meeus) and the U.S. Naval Observatory’s sidereal-time formula. Against NASA JPL’s Horizons at 1,250 random instants from 1900 to 2100 at 60 places, with the Sun up, its bearing differs by 0.002° typically and by at most 0.03° while the Sun is below 80° altitude. Polaris is the Hipparcos catalogue position carried forward with the IAU 2006 precession, leaving out nutation and aberration, which together move it by less than 30 arcseconds: at most 0.015° of bearing up to 60°N and 0.02° up to 70°N. Declination is the World Magnetic Model 2025 at sea level for your position and date (1 January 2025 to 31 December 2029) — 3 km of height changes it by under 0.01° at Casper — and it is the main field only, with no local rock and no magnetic storms. The time is read as your device’s clock and zone unless you choose otherwise. A shadow needs an upright object; sunrise and sunset need a level horizon. Nothing you enter leaves the page.
What the numbers mean
Compass error is the true bearing minus what the compass read. Navigators name it by direction rather than sign: Bowditch’s rule (§1501) is that the error is west when the compass reads more than the true bearing and east when it reads less. The calculator follows it, so an error of 2° E means the compass reads 2° low.
For a magnetic compass the error has two parts. One is declination (a navigator’s variation): the angle between true north and the local magnetic field, which the declination calculator works out from the World Magnetic Model. The other is deviation: whatever is left once declination is taken off. Deviation is the part that belongs to you — steel nearby, a magnet in a pocket, a phone that needs calibrating, or a local magnetic anomaly in the ground:
A check cannot be sharper than the measurement, so the calculator compares the deviation with an allowance built from three stated parts, and says which side of it you are on:
- The model. NCEI publishes an error model for WMM2025 in which the one-standard-deviation uncertainty of declination is
√(0.26² + (5417 / H)²)degrees, with H the horizontal field strength in nanotesla. The allowance takes twice that: 0.76° at Casper, Wyoming, where H is about 19,600 nT. - Your reading. How finely you can read the compass, ±1° unless you change it under “More options”.
- Your clock. The rate the Sun’s bearing is moving at that moment, times how far off the time might be (±30 seconds unless you change it).
The allowance is the three added together. It is a rule built from those parts, not a statistical test, and every part is printed with the result so you can see which one dominates. A gyrocompass has no declination, so its allowance is the reading and the clock alone.
When the deviation is larger than the allowance, something other than declination is turning the compass. Most often it is nearby steel or a magnet (see magnetic interference), or, on a phone, a magnetometer that needs calibrating (see how a phone compass finds its heading). It can also be the ground itself: NCEI notes that local declination anomalies of 3 or 4 degrees are not uncommon, though usually over small areas, and that some exceed 10 degrees — none of which a global model contains. Before blaming the compass, check the time zone, and repeat the check somewhere else.
Where the Sun is: the calculation
Three steps turn a date, a time and a position into the Sun’s true bearing: where the Sun is on the sky, how far Earth has turned, and what that looks like from where you stand.
1. The Sun on the sky
The calculator uses the equations of the NOAA Global Monitoring Laboratory’s solar calculator, which NOAA says are based on Jean Meeus’s Astronomical Algorithms and are very good between 1800 and 2100. From the time T in Julian centuries since noon on 1 January 2000, the Sun’s mean longitude and mean anomaly give its true longitude, then its apparent longitude λ, and from that its right ascension α and declination δ:
2. How far Earth has turned
The Sun’s local hour angle (LHA) is how far west of your meridian it is. It comes from sidereal time, for which the U.S. Naval Observatory publishes a short formula good to about 0.1 second of time; its stated maximum error from 2000 to 2100 is 0.432 seconds, about 0.002°:
3. From the sky to your horizon
The navigational triangle gives the altitude Hc and the azimuth angle Z, measured from north. The altitude equation is the one in NOAA’s code; the azimuth equation is the one Bowditch §1506 uses for amplitudes, since an amplitude is the complement of the azimuth angle:
Atmospheric refraction lifts the Sun straight up in its own vertical circle, so it changes the altitude and not the bearing. That is why none of the bearing arithmetic needs a refraction correction — except at sunrise and sunset, where refraction decides when the Sun sits on the horizon.
How close it gets
Checked against the U.S. Naval Observatory’s celestial navigation data service and NASA JPL’s Horizons system, for the same places and instants:
| Place | Time (UTC) | USNO Zn | JPL Zn | This page |
|---|---|---|---|---|
| Casper, WY | 2026-06-20 18:30 | 155.615° | 155.615° | 155.608° |
| Casper, WY | 2026-09-23 18:00 | 159.450° | 159.450° | 159.453° |
| Casper, WY | 2026-12-21 19:00 | 179.133° | 179.132° | 179.132° |
| Sydney | 2025-01-15 03:00 | 312.640° | — | 312.648° |
| Reykjavik | 2028-02-29 12:00 | 154.157° | — | 154.157° |
| Singapore | 2029-11-11 06:30 | 231.779° | — | 231.780° |
| Ushuaia | 2026-05-10 15:10 | 19.659° | — | 19.667° |
Positions: Casper 42.8666°N 106.3131°W, Sydney 33.8688°S 151.2093°E, Reykjavik 64.1466°N 21.9426°W, Singapore 1.3521°N 103.8198°E, Ushuaia 54.8019°S 68.3030°W, all at sea level, with the Sun’s centre and no refraction.
Seven rows prove little, so the calculator was also run against Horizons at 1,250 random instants from 1900 to 2100, spread over 60 random places between 80°S and 80°N, all with the Sun above the horizon. The median difference in bearing is 0.002°. With the Sun below 80° altitude the largest is 0.03°; above 80° it reaches 0.05°, because near the zenith a tiny shift of the Sun swings its bearing a long way. Most of it is the NOAA equations themselves, which place the Sun within about 30 arcseconds of JPL. Even the worst case is a third of the 0.1° Bowditch works compass errors to.
The clock matters more than the astronomy
The Sun’s bearing never stands still, and its rate follows from differentiating the equations above:
| Casper, WY, 2026 | Sun’s altitude | Bearing moves per minute |
|---|---|---|
| 23 September, 9:00 a.m. MDT | 21.7° | 0.20° |
| 23 September, 1:00 p.m. MDT (near noon) | 46.8° | 0.37° |
| 21 December, noon MST | 23.7° | 0.25° |
| 21 June, 1:06 p.m. MDT (about solar noon) | 70.6° | 0.69° |
So a time two minutes out at midday in June is worth more than a degree of apparent compass error. The usual mistake is not the clock itself but writing the time down late, or entering it in the wrong time zone. The high summer Sun is also the hardest to take a bearing on, because a sight line tilted sideways by a small angle τ is off in bearing by about τ × tan Hc — 1.7° for each degree of tilt at 60° altitude, 2.7° at 70°. That is the case for the shadow.
Compass error by amplitude: sunrise and sunset
On the horizon the Sun’s bearing depends only on your latitude and its declination, so no clock is needed. Navigators express it as the amplitude A: the angle from due east (rising) or due west (setting), north of it when the Sun’s declination is north. Bowditch §1506 gives the general formula for a body at computed altitude Hc, with north latitudes and declinations positive:
The awkward part is saying where the Sun was. Refraction, the dip of the horizon and the Sun’s own size mean that the geometric horizon is not where it looks. The calculator offers the three definitions in the sources:
- Top edge on the horizon — the U.S. Naval Observatory’s sunrise and sunset, computed with the Sun’s centre 50 arcminutes below a level horizon (Hc = −0.8333°). For most people this is the moment to use: the first or last sliver.
- On the visible horizon at sea — the value Bowditch uses for the Sun on the visible horizon, Hc = −0.7° (§1506). Bowditch does not say which part of the disc it means; the value lies between the other two.
- Celestial horizon (Hc = 0) — according to Bowditch (§1503), when the Sun’s lower edge is about two-thirds of a diameter above the visible horizon.
Which one you pick matters more the further you are from the equator. At the equinox, when δ is zero, the formula gives a bearing change of tan L degrees for each degree of altitude:
| Latitude (Sun at the equinox) | Bearing change per degree of altitude | Top edge versus celestial horizon |
|---|---|---|
| 0° | 0.00° | 0.00° |
| 30° | 0.58° | 0.48° |
| 42.9° (Casper) | 0.93° | 0.77° |
| 60° | 1.73° | 1.44° |
| 65° | 2.15° | 1.79° |
The same factor multiplies any error in the horizon itself. A line of hills half a degree high at 60°N moves the sunrise bearing by about 0.9°. Refraction is the other unknown: the Naval Observatory’s average at the horizon is 34 arcminutes, and NOAA notes that the atmosphere’s effect varies with pressure, humidity and other variables. That is why Bowditch recommends, at higher latitudes, observing on the visible horizon rather than judging where the celestial horizon is (§1505), and why the sea or a flat plain gives the cleanest check.
Polaris
Polaris is not exactly at the celestial pole. In 2026 it is 0.63° from it, so it circles the pole once a sidereal day and its bearing swings either side of true north. The largest swing grows with latitude: 0.86° at Casper, 1.25° at 60°N, 1.48° at 65°N. South of about 51°N it is never more than 1° from north. The Nautical Almanac tabulates its azimuth from the equator to 65°N against the local hour angle of Aries (Bowditch §1502); the calculator works it out directly instead:
- Start from the Hipparcos position (van Leeuwen, 2007, as given by SIMBAD): right ascension 02h 31m 49.09456s, declination +89° 15′ 50.7923″ for J2000, with proper motion 44.48 and −11.85 milliarcseconds a year.
- Carry it to the date with the IAU 2006 precession angles ζA, zA and θA (USNO Circular 179, equation 5.11).
- Find its local hour angle from sidereal time and put it through the same altitude and azimuth equations as the Sun.
Nutation and aberration are left out. Together they shift Polaris by less than 30 arcseconds, and the bearing error that causes grows roughly as one over the cosine of your latitude: at most 0.011° at Casper’s latitude, 0.015° up to 60°N, 0.02° up to 70°N and 0.04° up to 80°N. In sixty comparisons with the Naval Observatory at random places from 2°N to 67°N and random times from 2016 to 2035, the largest difference was 0.013°. Closer to the pole Polaris stands nearly overhead, where its bearing is poorly defined, and the calculator says so. Its bearing changes by at most 0.004° a minute at Casper, so the clock hardly matters. Polaris is magnitude 2.0. The Naval Observatory describes nautical twilight, with the Sun 6° to 12° below the horizon, as the time when the horizon is still visible and mariners can take reliable star sights.
Bowditch’s worked examples, reproduced
Chapter 15 of the 2017 American Practical Navigator works four compass checks, using Pub. 229, the Nautical Almanac, Bowditch’s own amplitude tables and, in §1506, the amplitude formula. Each button below loads one into the calculator, so you can watch it produce the answer. They load as a gyrocompass read to ±0.1°, the precision Bowditch works to (§1500).
| Example | Given | Bowditch | This page | Try it |
|---|---|---|---|---|
| §1501, the Sun by azimuth | Latitude 23°55.0′N, declination 8°47.4′S, LHA 317°37.4′; gyro 124.0° | Zn 123.2°, error 0.8° W | Zn 123.19°, error 0.8° W | |
| §1502, Polaris | 23 February 2016, 04:21:15 GMT, 29°31.0′N 074°30.0′W; gyro 359.9° | Zn 359.2°, error 0.7° W | Zn 359.25°, error 0.7° W | |
| §1504, sunset, celestial horizon | Latitude 51°24.6′N, declination 19°40.4′N; gyro 303° | Amplitude 32.6°, Zn 302.6°, error 0.4° W | Amplitude 32.67°, Zn 302.67°, error 0.3° W | |
| §1505–1506, sunrise, visible horizon | Latitude 59°47′N, declination 5°11.3′S; gyro 098.5° | Amplitude 9.1°, Zn 099.1°, error 0.6° E | Amplitude 9.13°, Zn 99.13°, error 0.6° E |
Three of the four agree to Bowditch’s last digit. The Polaris example is worth a closer look, because here the calculator starts from the date and the clock rather than from almanac values: its sidereal time gives the Greenwich hour angle of Aries as 217°49.28′, against the almanac’s 217°49.3′, and its bearing of 359.246° matches the Naval Observatory’s 359.250° for the same moment; the almanac table, read by eye, gives 359.2°.
The one that differs is §1504. Bowditch interpolates Table 22 between its nearest entries and gets an amplitude of 32.6°; the formula it prints in §1506 gives 32.67°, so the true bearing is 302.67° and the error 0.33° W rather than 0.4° W. Bowditch itself rounds the answer to half a degree west, and says in §1500 that for steering, errors are reasonably rounded to the nearest half or whole degree. Its §1505 amplitude on the celestial horizon, 10.3° from the tables, compares with the formula’s 10.35°.
What a sun check cannot tell you
- It measures one bearing. Anything magnetised that moves with the compass — a phone’s own components, a compass mounted in a vehicle — turns it by an amount that changes as you turn. A clean check on one bearing says nothing certain about another, so check twice at bearings well apart: a morning and an afternoon shadow, or a shadow and Polaris.
- It is only as good as the time and the place. See the rates above. A position a few kilometres out hardly matters; a time zone an hour out moves the Sun by about 15° of hour angle and the calculator will report a large, false error.
- A shadow needs an upright object, not level ground. The shadow of a vertical pole lies in the vertical plane through the pole and the Sun, so on a slope it is longer or shorter but points the same way. A pole leaning sideways is another matter: a lean of τ turns the shadow by about τ × tan Hc, 0.6° per degree of lean with the Sun 30° high. Check the pole against a plumb line.
- Declination is a model. WMM2025 contains the field from Earth’s core, not local rock and not magnetic storms. Where the deviation comes out large and the compass passes everywhere else, the ground may be the cause. In NCEI’s blackout zones near the magnetic poles, where H is under 2,000 nT, NCEI says compasses are not accurate and should not be relied on for navigation; the calculator flags it, and the caution zone out to 6,000 nT.
- Dates. The Sun is calculated for 1900 to 2100 and has been checked against JPL across that whole range. WMM2025 runs from 2025 to the end of 2029; outside that window, enter a declination of your own under “More options” to split error from deviation.
Checking all the time, not once
A sun check is one measurement, at one place, on one bearing. Bearing, our Android compass, runs a different test continuously: about twice a second it compares the strength of the field its magnetometer measures with the strength Android’s built-in geomagnetic model gives for your position, and warns when they differ by more than 18%. That catches a magnet or a mass of steel close enough to change the field’s strength. It can miss a stray field pointing sideways to Earth’s, which turns the heading while changing the strength far less — the magnetic interference page works through a sideways field that costs 45.6° of heading and changes the strength by 7% — and that is exactly the error a sun check catches. The two tests cover each other.
Bearing reads true or magnetic north and shows whole degrees, so when you check it here, choose the matching compass type and allow at least ±0.5° for the rounding alone. It works offline, and its ads are removable with a one-time purchase.
Related: magnetic declination and true north, magnetic interference and phone compasses and how a phone compass finds its heading. All the instruments →
Sources
- N. Bowditch, The American Practical Navigator (NGA Pub. 9, 2017), Chapter 15, Azimuths and Amplitudes — §1500–1506: compass error, naming east and west, the four worked examples, the amplitude formulas, Hc = −0.7°, the celestial horizon.
- NOAA Global Monitoring Laboratory, Solar Calculation Details and the source of its solar position calculator — the solar equations, their basis in Meeus, the 1800–2100 range, the altitude equation.
- U.S. Naval Observatory, Computing Approximate Sidereal Time — GMST, the equation of the equinoxes, the stated accuracy.
- U.S. Naval Observatory, Rise, Set, and Twilight Definitions — sunrise at 90.8333° zenith distance, average refraction at the horizon; civil and nautical twilight.
- G. H. Kaplan, USNO Circular 179 (2005) — section 5.4.1, equation 5.11, the IAU 2006 precession angles.
- SIMBAD, Polaris (α UMi) — position and proper motion from van Leeuwen (2007), and the V magnitude.
- NOAA NCEI, World Magnetic Model, its WMM2025 test values, and Accuracy, Limitations, and Error Model — validity dates, the declination error model, blackout and caution zones, crustal anomalies.
- U.S. Naval Observatory, celestial navigation data service and NASA JPL Horizons — the reference bearings the calculator was checked against.