Is My Digital Compass Working?
Start the test and rotate your device horizontally. A Canvas compass needle points north in real time, with heading displayed in degrees and cardinal direction (N, NE, E, SE, S, SW, W, NW).
This test reads the DeviceOrientationEvent.alpha property from the magnetometer to display a real-time compass heading in degrees (0–360°) with cardinal direction labels.
0° points north, 90° east, 180° south, 270° west; accuracy depends on magnetic interference and device calibration.
Sensor access is required to run this test.
What Do Your Results Mean?
| Result | Range | Meaning |
|---|---|---|
| Good | Heading updates smoothly, matches physical direction | Your magnetometer is calibrated and working correctly. The compass needle tracks north accurately as you rotate. |
| Warning | Heading drifts or jumps erratically | Magnetic interference from metal objects, phone cases, or nearby electronics. Move away from interference sources and calibrate by moving the phone in a figure-8 pattern. |
| Bad | No heading data or value stays fixed | The magnetometer is not available or permission was denied. On iOS, grant orientation sensor access when prompted. |
Common Issues and How to Fix Them
Compass shows wrong direction or drifts
Calibrate the magnetometer by slowly waving your phone in a figure-8 motion several times. Move away from metal objects, magnets, and electronic devices.
No heading data appears on iOS
iOS 13+ requires explicit permission for DeviceOrientationEvent. Tap Start to trigger the prompt and grant access. Ensure the site is served over HTTPS.