Online compass
Press Start, allow motion access if asked, and hold your phone flat. The dial turns so that N points to magnetic north, and the heading shows below in degrees with the nearest direction (N, NE, E and so on). It needs a phone or tablet with a magnetometer, so desktop computers will show a no-sensor message.
Runs in your browser: nothing you enter is sent anywhere.
How to use it
- Press Start and allow motion access if asked.
- Hold the phone flat, with the top of the screen pointing the way you are facing.
- Read the heading in degrees. 0° is north, 90° east, 180° south and 270° west.
- If it seems off, wave the phone in a figure eight and check away from metal.
How it works
On iPhone the browser supplies a ready compass heading. On Android the page listens to the absolute orientation event, where the angle alpha is measured counter-clockwise from north, so the heading is 360 − alpha. The eight directions each cover 45°, centred on the direction, so north is 337.5° to 22.5°. Events only arrive while the page is running; Stop removes the listener.
Worked example
If Android reports alpha = 90°, the heading is 360 − 90 = 270°, which is W (west). A heading of 100° falls between 67.5° and 112.5°, so it reads E.
Tips
- Check with a known landmark or a trusted compass before relying on it for navigation.
- Do not use it in a car or beside a laptop; both disturb the magnetic field.
Frequently asked questions
Why does it say no sensor on my computer?
Desktop and most laptop computers have no magnetometer, so the browser sends no heading. Open the page on a phone or tablet.
Why does my iPhone ask for permission?
Safari on iPhone and iPad shares motion and orientation data only after you agree. Tap Start and allow it. If you refused by mistake, reload the page and try again.
Is this magnetic north or true north?
Magnetic north, as measured by the phone's sensor. The difference from true north (declination) depends on your location and can be several degrees, more in some regions.
Why is the heading wrong or jumping?
Magnets, metal tables, car bodies and phone cases with magnets disturb the sensor. Move away from them and calibrate by moving the phone in a figure eight. Hold it flat, because tilting changes the reading on some devices.