How the online compass works
Your phone has a magnetometer that senses the Earth's magnetic field. The browser combines it with the motion sensors to work out which way the top of the phone is pointing. This page turns that into a heading in degrees, where 0° is north, 90° east, 180° south and 270° west, and spins the dial so N always points north.
The heading is magnetic north, which can differ from true north by a few degrees depending on where you are.
Getting an accurate reading
- Hold the phone flat and level, screen facing up.
- Move away from metal such as cars, steel desks, speakers and laptops.
- Take off magnetic cases and wallet covers.
- Calibrate by waving the phone slowly in a figure-of-eight a few times.
Frequently asked questions
Why does it say no compass was found?
The device may not have a magnetometer (most laptops don't), or the browser may only offer tilt data. Chrome on Android and Safari on iPhone usually work.
The heading jumps around.
Something magnetic is probably nearby. Move a few steps away and calibrate with a figure-of-eight motion.
Can I see the raw sensor values?
Yes, on the gyroscope test.