On this page
Compass Test
Live heading in degrees with a 16-point direction label, an eight-direction target sweep, a five-second stability check and a figure-eight calibration guide.
- Available — Live on this site right now.
- Browser Tool — Runs in the browser you are reading this in.
- No Install — Nothing to download, no extension, no account.
- Client-Side — Runs entirely on your device. No test data is uploaded.
- Requires Permission — Asks your browser for access before it can run.
- Mobile — Built for phone and tablet hardware.
This page explains the tool. The tool itself is one click away and needs no sign-in.
Open Compass TestWhat is this tool?
The Compass Test shows which way your phone is pointing, as a heading in degrees from 0 to 360 and as a named direction from a 16-point scale. It reads the browser's orientation events, which combine the magnetometer with the accelerometer and gyroscope to produce a heading.
Three sources are tried in order. On iOS the engine uses webkitCompassHeading directly, which is already a heading in degrees and can also report an accuracy figure. On Android Chrome it uses absolute orientation and converts with the standard formula heading = 360 − alpha. Failing both it falls back to relative orientation, which is not a true compass — and the panel says which source is in use.
Three exercises sit on top: an eight-direction target sweep to prove the full circle is reachable, a five-second stability test to quantify interference where you are standing, and a calibration guide for the figure-eight motion that the OS uses to re-learn the magnetometer's offsets.
How to use it
- Start the test and grant permissionOrientation access needs HTTPS, and on iPhone and iPad it needs an explicit grant from your tap. Accept the prompt; without it the heading will not update at all.
- Check the source and whether it is absoluteLook at the status panel before trusting any number. Absolute means the heading is referenced to the Earth's magnetic field and is a real compass. Relative means it is referenced to wherever the device happened to start, so the needle will move correctly but north will be wrong.
- Hold the phone flat and turn slowlyKeep it level, face up, and rotate your whole body rather than twisting your wrist. The heading should change smoothly through the full circle, and the 16-point label should step through north, north-northeast, northeast and so on.
- Run the eight-direction target testEight targets sit at 0°, 45°, 90°, 135°, 180°, 225°, 270° and 315°. Each is marked as reached when your heading comes within 15 degrees of it, so clearing all eight proves the sensor covers the whole circle without a stuck sector.
- Run the five-second stability testStand still, hold the phone steady and press start. The engine samples the heading for five seconds and reports the largest angular deviation from the first sample, wrapping correctly around 360° so a heading near north is not falsely penalised.
- Calibrate if the heading is wrong or unstableFollow the figure-eight guide: hold the phone flat and trace a large figure eight in the air several times, rotating your wrist as you go. That gesture is what the OS uses to re-estimate the magnetometer's offsets; the page guides it but the OS performs it.
What the results mean
Heading in degrees
0 to 360, normalised so it never goes negative or exceeds a full turn. 0° is north, 90° east, 180° south, 270° west. On Android the value is derived as 360 − alpha because the orientation API's alpha runs anticlockwise while a compass heading runs clockwise.
16-point direction
The heading snapped to the nearest of sixteen names, each covering 22.5 degrees — north, north-northeast, northeast, east-northeast and so on. It is the label a walker actually uses, and it is derived from the same heading rather than measured separately.
Source and absolute flag
webkitCompassHeading, absolute orientation or relative orientation. This is the most important line on the page: only the first two are true compasses, and a relative reading tells you the sensor works while telling you nothing about where north is.
Accuracy
A ± figure in degrees, shown only when the browser supplies one — in practice iOS via webkitCompassAccuracy. A large number means the OS itself is unsure and wants a calibration motion.
Eight-direction coverage
How many of the eight cardinal and diagonal targets you have reached within the 15-degree tolerance. Anything short of eight after a full slow turn points at a sector the sensor is not reporting.
Stability verdict
The maximum deviation over five stationary seconds, labelled Stable below 3°, Moderate Variation up to 8° and High Interference beyond that. Fewer than three samples reports as not enough data rather than guessing.
Sensor responsiveness and raw data
Event count and update rate, plus the raw alpha, beta and gamma values behind the heading. Alpha is the rotation about the vertical axis; beta and gamma describe front-to-back and side-to-side tilt, and both affect a magnetometer heading.
What it can detect
- Whether a magnetometer heading is available at all, and whether it is absolute or merely relative
- A stuck or missing sector of the circle, from the eight-direction sweep
- Local magnetic interference, quantified as maximum deviation over a stationary five-second window
- A compass that needs calibration — a heading that is smooth but consistently wrong, or an accuracy figure that stays large
- Whether the browser exposes an accuracy estimate, which iOS does and most Android browsers do not
- Whether orientation events are being delivered at a usable rate, or throttled
- Whether the page is blocked by an insecure context or a denied permission, reported as such rather than as a zero heading
Limits worth knowing
A browser can only report what the platform gives it. These are the honest boundaries of this page, so a result is never read as more than it is.
- It cannot calibrate your compass. The figure-eight motion is performed by you and processed by the operating system's sensor fusion; the page can only guide the gesture, which its own “Can a website calibrate my phone's compass hardware?” FAQ confirms.
- It shows magnetic north, not true north, unless your platform has already corrected for declination. The difference between the two varies by location and can be more than ten degrees, and a web page cannot compute it without knowing where you are — which this page does not ask.
- It cannot read magnetic field strength in microtesla, the magnetometer's model, or its internal accuracy state. Only a heading, and sometimes an accuracy figure, cross the browser boundary.
- A relative-orientation fallback is not a compass. When the source line says relative, the needle still responds to rotation but the zero point is wherever the device started, so the absolute direction is meaningless.
- It cannot separate interference from a hardware fault. Steel desks, laptops, speakers, magnetic cases, phone holders and reinforced concrete floors all distort a magnetometer, which is why the stability test exists and why the page suggests moving before concluding anything.
- Orientation access requires a secure HTTPS context, and an explicit permission grant on iPhone and iPad. Desktops have no magnetometer, so there is nothing to read there.
- Nothing about your heading or location is transmitted, and the page never asks for geolocation — which is why it cannot correct for declination even in principle.
Tips
- Step away from your desk before judging the compass. A laptop, a monitor and a steel desk frame together will bend a heading by tens of degrees, and moving two metres often turns High Interference into Stable.
- Check whether a magnetic case or a MagSafe wallet is attached. A magnet held permanently against the phone is the single most effective way to make a compass permanently wrong, and no amount of calibration fixes it while it is there.
- Read the source line before believing the needle. If it says relative, the heading is not referenced to north at all, and the eight-direction test is measuring rotation rather than direction.
Troubleshooting
It says permission required.
On iPhone and iPad, DeviceOrientationEvent needs an explicit grant from a tap, over HTTPS. Press the start button and accept the prompt; if you previously declined, clear this site's settings in Safari and reload.
My heading is completely wrong.
First check whether the source is absolute — a relative reading has no true zero. If it is absolute, remove any magnetic case, move away from metal and electronics, and perform the figure-eight motion a few times.
The heading jumps around while I stand still.
Run the stability test to put a number on it. Beyond 8° of deviation the engine calls it high interference, which almost always means the environment rather than the phone — move and test again before assuming a fault.
My desktop says compass not available.
Expected — desktop machines have no magnetometer. Open the page on a phone or tablet.
I cannot clear all eight direction targets.
Turn your whole body slowly through a full circle while holding the phone flat, and pause on each target: the tolerance is 15 degrees, so passing quickly through a direction may not register. If one sector never triggers after a careful sweep, note which one — that is the reportable symptom.
Ready to run it?
Live heading in degrees with a 16-point direction label, an eight-direction target sweep, a five-second stability check and a figure-eight calibration guide. Nothing to install, and it opens in this browser.