Compass / Magnetometer Test
Check the magnetometer, and find out whether your heading has a real reference at all.
—
Result
No orientation events arriving
Nothing is being delivered. On a desktop machine that is expected — there is no magnetometer. On a phone it usually means the page is not on a secure connection.
What this cannot tell you
- Alpha is only a compass bearing when the orientation event is absolute. On many Android devices it is measured from wherever the phone happened to be when the page loaded, which is not a heading at all — and the result says which of those you have.
- Magnetic north is not true north. The declination between them reaches tens of degrees in parts of the world, and no browser applies the correction except where the platform already has.
- Magnetometers drift and need calibration. Metal, magnets and phone cases with magnetic closures all distort the reading substantially.
- iOS requires an explicit permission grant, and the request must come from a tap.
- Only reports what the platform exposes. Browsers receive an operating-system estimate rather than a raw sensor reading, and the raw sensor is not available to any web page.
- Nothing is stored or sent anywhere. Readings are rendered in the page and gone when you leave.
Take this with you
How this test works
Orientation events are read, preferring the absolute variant where the browser provides one. On iOS a true-north heading is available directly and the platform has already applied magnetic declination. Elsewhere the standard alpha value is used — but only counts as a bearing when the event is marked absolute, because otherwise it is measured from an arbitrary starting orientation rather than from north. That distinction is the main thing this tool checks, since a page reading alpha and presenting it as a compass bearing is often reporting a number with no fixed reference whatsoever. Rotation range is tracked alongside so a magnetometer that sticks or jumps rather than tracking smoothly is visible as needing calibration.
What the results mean
- Heading
- Degrees clockwise from the reference, with the cardinal direction beside it.
- Reference
- True north, magnetic north, or an arbitrary starting point. Only the first two are bearings.
- Declination applied
- Whether the platform corrected magnetic north to true north. Only iOS does.
- Rotation seen
- How far the heading has swept. Turn a full circle — sticking or jumping means calibration is needed.
Common problems and fixes
- The heading is wrong by a fixed amount
- If the reference is magnetic north, that offset is declination and is expected. It reaches tens of degrees in some regions and has to be added to match a map.
- The needle sticks or jumps
- The magnetometer needs calibrating. Move the phone in a figure-of-eight a few times, away from anything metal.
- It says my heading has no fixed reference
- The browser is not providing an absolute orientation event, so alpha is relative to wherever the device was at page load. No web page can give you a true heading on that device.
Frequently asked questions
Why is my compass reading different from a map bearing?
Magnetic declination. Magnetic north and true north differ by an angle that depends on where you are, reaching tens of degrees in some places. Only iOS applies the correction; elsewhere you have to add it yourself.
Why does my phone ask me to wave it in a figure of eight?
That is magnetometer calibration. The sensor drifts and is affected by nearby metal, and the motion lets the platform re-establish its reference against the earth's field.
Can a website give me a true compass heading?
On iOS yes, because the platform provides a true-north heading directly. On Android only where the browser supplies an absolute orientation event — without one, the value has no fixed reference and is not a bearing.