Skip to main content
FreeOnlineInstant ResultsRuns LocallyNo Install
Mobile Sensor Testing

Compass Test

Test your device compass and check heading, direction and orientation directly in your browser.

Sensor:MAGNETOMETERAPI:DEVICEORIENTATIONTargets:8 DIRECTIONSTolerance:±15°

Compass Test · Live Heading

Ready to Test
Current Heading
0.0°N
NORTH
Waiting for DataAccuracy: Not Available

8-Direction Target Test

0 / 8 Detected

Rotate your device toward each target direction (tolerance ±15°) to verify 360° sensor range.

N (0°)Target
NE (45°)Target
E (90°)Target
SE (135°)Target
S (180°)Target
SW (225°)Target
W (270°)Target
NW (315°)Target

Heading Stability Test

5s

Place your device flat on a stable surface for 5 seconds to measure stationary heading drift and magnetic noise.

Calibration Guide

If your heading appears offset, wave your phone in a figure-eight motion to allow your OS driver to calibrate.

Raw Orientation Data

Compass Status

Orientation APIDetecting...
PermissionNot Requested
Sensor ActiveNo

Sensor Responsiveness

Sensor Events0
Event Rate—
Test Duration00:00
Magnetic Advisory

Magnetic cases, desktop monitors, laptops, and speakers distort magnetometer readings. For accurate North detection, test in an open space.

Privacy GuaranteeCompass heading and orientation coordinates are processed 100% locally in your browser and are never uploaded to any remote server.
Hardware Sensor Diagnostics

Compass Test Guide

Learn how mobile magnetometers calculate compass heading, how to clear magnetic interference, and how web orientation APIs work.

01. What Is a Compass Test?

A compass test evaluates your smartphone's internal magnetometer sensor and spatial orientation capabilities. Unlike traditional mechanical compasses that rely on a magnetized floating needle, digital smartphone compasses use solid-state Hall-effect or magnetoresistive microchips to measure the strength and direction of Earth's geomagnetic field across three spatial axes.

Using web orientation standards, this tool measures your device's heading in degrees ($0^\circ$ to $360^\circ$) and translates the mathematical angle into cardinal directions without requiring third-party native apps.

02. How to Test a Phone Compass

  1. Start the Sensor: Tap "Start Compass Test" above to activate the browser's orientation listeners.
  2. Grant Permission: On iOS 13+ devices, tap "Allow" when Safari prompts for motion & orientation access.
  3. Hold Flat: Keep the device parallel to the ground for optimal magnetometer accuracy.
  4. Rotate Slowly: Turn your body 360 degrees to verify that the compass dial rotates smoothly without sticking.
  5. Complete Target Directions: Align with North, East, South, and West to complete the 8-direction test.
  6. Inspect Stability: Rest the phone on a stable surface for 5 seconds to verify baseline stability.

03. How a Phone Compass Works

Modern mobile devices achieve compass navigation through sensor fusion:

  • Magnetometer: Detects Earth's geomagnetic field vector (X, Y, Z) in microteslas (µT).
  • Accelerometer: Detects gravity to calculate pitch and roll, allowing the software to compensate for device tilt (tilt-compensated compass).
  • Gyroscope: Provides high-speed angular rotation rates to filter out rapid vibrations and noise.

04. How to Calibrate a Compass

Magnetometers collect magnetic offsets from nearby metal components over time. To recalibrate:

  1. Step away from cars, computers, power transformers, and metal structures.
  2. Hold the phone securely and move it through the air in a large figure-eight (∞) pattern.
  3. Twist your wrist slightly on each loop so the sensor samples all 3 spatial dimensions.
  4. Your phone's internal Kalman filter will automatically recalibrate its magnetic baseline.

05. Why Is My Compass Wrong?

If your compass points in the wrong direction:

  • Magnetic Phone Cases: Magnetic mounts and wallet cases with magnetic clasps are the #1 cause of false headings.
  • Indoor Electromagnetic Fields: Wiring inside walls, laptop speakers, and appliances deflect magnetic North.
  • Relative Orientation Mode: If your browser only supports relative orientation, the angle is measured relative to your phone's starting position rather than magnetic North.
  • Magnetic Declination: Depending on your geographic location, magnetic North can differ from true geographic North by up to 20°.

06. Compass vs Gyroscope

A gyroscope measures the speed of rotation around an axis (angular velocity in rad/s), detecting how fast you are turning. However, a gyroscope cannot tell which direction is North.

A compass measures your absolute orientation relative to the planet's magnetic field. Operating systems combine both sensors to provide smooth, drift-free navigation.

07. Sensor Accuracy & Limitations

Browser-based compass testing is designed for diagnostic verification of web hardware APIs. While suitable for everyday orientation checks, browser-level readings should never replace dedicated marine, aeronautical, or professional surveying instruments.

Frequently Asked Questions

Answers to common mobile compass, magnetometer, and heading accuracy questions.

How does this online compass test work?

This test queries the W3C DeviceOrientationEvent API and Apple's `webkitCompassHeading` property to measure your device's physical orientation relative to magnetic North. As you turn your phone, the circular compass dial rotates in real time to reflect your current heading.

What is the difference between Absolute and Relative orientation?

Absolute orientation measures heading relative to Earth's magnetic or true North using an internal magnetometer. Relative orientation only tracks rotation relative to the arbitrary angle the phone was facing when the browser listener started. This tool clearly indicates whether your heading is Absolute or Relative.

Why does it say 'Permission Required' on iPhone?

Starting with iOS 13, Apple requires explicit user permission before web pages can read orientation and motion sensors. Tapping 'Start Compass Test' triggers Safari's native permission dialog.

Why does my desktop computer say 'Compass Not Available'?

Standard desktop PCs, monitors, and laptops lack physical magnetometer chips. The tool honestly displays 'Compass Not Available' rather than simulating fake compass movement.

What is the 8-Direction Target Test?

The 8-direction test challenges you to rotate your phone toward North (0°), Northeast (45°), East (90°), Southeast (135°), South (180°), Southwest (225°), West (270°), and Northwest (315°). When your heading aligns within ±15°, the target lights up as '✓ Detected'.

How does the 5-second Stability Test work?

Placing your device stationary on a table and running the stability test samples heading drift over 5 seconds. It calculates maximum angular variation and rates stability as 'Stable' (<3°), 'Moderate Variation' (3–8°), or 'High Interference' (>8°).

How do I perform the figure-eight calibration motion?

Hold your phone flat in your hand and move it smoothly through the air in the shape of a sideways figure-eight (∞) while gently tilting your wrist. This allows the internal magnetometer to map ambient magnetic distortions and recalibrate its zero reference.

Can a phone case affect compass accuracy?

Yes! Cases with magnetic clasps, metal kickstands, magnetic mount plates, or ring holders generate strong localized magnetic fields that can deflect compass readings by 30° to 180°.

What is the difference between Magnetic North and True North?

Magnetic North is the direction to the Earth's magnetic North Pole, indicated by magnetometers. True North is the geographic North Pole. The angular difference between the two is called 'magnetic declination'.

Why does my heading fluctuate slightly even when stationary?

Micro-Electro-Mechanical Systems (MEMS) magnetometers are sensitive to ambient electrical currents, nearby electronics, and thermal drift. Fluctuations of 1° to 2° are completely normal in indoor environments.

Does this compass test require an HTTPS connection?

Yes. Modern web browsers strictly restrict device orientation and motion sensor access to secure HTTPS contexts to prevent unauthorized fingerprinting.

Does this test upload my location or heading?

No. All heading computations, dial animations, and target tests run 100% locally in your device's browser memory. No orientation or location data is ever transmitted to a server.

What is heading accuracy (±X°)?

On iOS Safari and compatible Android browsers, the orientation API exposes `webkitCompassAccuracy` or an accuracy radius in degrees. If unsupported by the device driver, the tool reports 'Accuracy: Not Available' rather than inventing a fake percentage.

Why does the compass dial rotate smoothly without spinning?

The compass engine uses shortest-path angular unwrapping. When turning past North (359° to 1°), the animation computes the +2° step rather than unwinding -358° backward.

What is a 16-point compass direction?

In addition to primary cardinal (N, E, S, W) and intercardinal (NE, SE, SW, NW) directions, 16-point compasses add intermediate points such as North-Northeast (NNE) and West-Northwest (WNW) in 22.5° intervals.

Can a website calibrate my phone's compass hardware?

No. Web pages run in a sandboxed environment without write permissions to system hardware calibration registers. Recalibration occurs at the operating system driver level when performing the figure-eight motion.

How does a compass differ from a gyroscope?

A gyroscope measures angular velocity (how fast the device is turning in rad/s or °/s). A compass measures absolute heading relative to Earth's magnetic field.

What browsers support compass orientation?

Apple Safari (iOS 13+ with permission), Google Chrome on Android, Samsung Internet, and Firefox on Android all provide DeviceOrientationEvent support.

Can I inspect the raw orientation numbers?

Yes. Expand the 'Raw Orientation Data' drawer to view live Alpha, Beta, Gamma, and Heading readings.

Can I test the compass in Fullscreen mode?

Yes. Tap the fullscreen button in the top header for an immersive full-screen compass display.