Home › Device & Internet Tests › Online Compass

Online Compass

Open this page on a phone or tablet, press Start compass and hold the device flat. The dial turns to show north, with your heading in degrees and as a cardinal direction.

–Press Start
Heading–
Locked bearing–
SensorNot started
° (E +, W −)
Advertisement
Advertisement

How to use the Online Compass

  1. Open the page on your phone and press Start compass. On iPhone and iPad, tap Allow when asked for motion and orientation access.
  2. Hold the phone flat, screen up, away from magnets, speakers and metal.
  3. Read your heading: the number at the top is the direction the top of your phone points to.
  4. Calibrate if needed by moving the phone in a figure 8 a few times.
  5. Lock a bearing to keep walking in the same direction, and enter your declination for true north.

Compass points and degrees

Headings are measured clockwise from north: 0° (or 360°) is north, 90° east, 180° south and 270° west. The 16-point compass rose splits the circle into 22.5° steps:

PointNameCenterRange
NNorth0°348.75°–11.25°
NNENorth-northeast22.5°11.25°–33.75°
NENortheast45°33.75°–56.25°
ENEEast-northeast67.5°56.25°–78.75°
EEast90°78.75°–101.25°
SESoutheast135°123.75°–146.25°
SSouth180°168.75°–191.25°
SWSouthwest225°213.75°–236.25°
WWest270°258.75°–281.25°
NWNorthwest315°303.75°–326.25°

How the browser finds north

Phones combine a magnetometer, accelerometer and gyroscope. Web pages read the result through the DeviceOrientation API:

  • iPhone and iPad (Safari) provide webkitCompassHeading, the heading in degrees from magnetic north, plus an accuracy value. Access must be granted with a tap.
  • Android (Chrome, Edge, Samsung Internet) fire deviceorientationabsolute events whose alpha angle is measured against north. Because alpha increases counterclockwise, the heading is heading = 360° − alpha.
  • The tool also adds the screen rotation angle, so the heading stays right when the phone is in landscape.

Magnetic north vs true north

A compass points to magnetic north, which is not the same as the geographic North Pole. The angle between them is the magnetic declination, and it changes with location and slowly over the years:

true heading = magnetic heading + declination (east declination positive, west negative).

PlaceApproximate declination (2025)
New York13° W (−13)
Chicago3° W (−3)
Denver7.5° E (+7.5)
Seattle15° E (+15)
London1° E (+1)
Sydney13° E (+13)

Look up the current value for your exact location with NOAA's magnetic field calculator before relying on it for navigation. This online compass is a handy guide, not a replacement for a proper compass in the backcountry.

Frequently asked questions

Why doesn't the compass work on my computer?

Laptops and desktop computers don't have a magnetometer (compass sensor), so the browser has no heading to report. Open the page on a phone or tablet instead.

How do I enable the compass on iPhone?

Press Start compass and tap Allow when Safari asks for access to motion and orientation. If you tapped Don't Allow, close the tab and reopen the page to be asked again. The page must be opened over https.

Why is the heading jumping or wrong?

The magnetic sensor is easily disturbed by magnets, phone cases with magnetic clasps, laptops, speakers, cars and steel structures. Move away from them and calibrate by moving the phone in a figure 8. Turning on smoothing also steadies the reading.

Does it show true north or magnetic north?

The sensor measures magnetic north. Enter your local magnetic declination (east is positive, west is negative) and tick True north to correct it. Declination is about −13° in New York, +13° in Seattle and close to 0° in much of Europe.

What does 'relative orientation only' mean?

Some browsers only report how the device has rotated since the page opened, not where north is. The dial then can't point to real north. Chrome on Android and Safari on iOS provide real compass headings.

Is my orientation data sent anywhere?

No. The sensor readings are processed in your browser only and are never uploaded or stored.

Related tools