Magnetometer Tester

Measure ambient magnetic field strength in microteslas and view a live compass needle. Start the magnetometer, chart real-time readings, and calibrate heading instantly.

Idle
Magnetic Field Magnetic field strength
0.00 µT
X axis0.00 µT
Positive toward the device's right side (east-west).
Y axis0.00 µT
Positive toward the top edge (north-south).
Z axis0.00 µT
Positive perpendicular to the screen (upward).
Realtime Chart Realtime field strength
20 Hz

Keep the device steady to track the Earth's field, or move near magnets to see spikes.

Compass Compass heading
N
E
S
W

Lay the device flat and rotate it slowly for the most stable heading.

About Magnetometer Tester

Magnetometer Tester visualizes the Earth's magnetic field in real time. Monitor X, Y, and Z axis readings, view the combined field strength on a live chart, and rotate a digital compass needle with precise headings. Perfect for testing phone sensors or exploring magnetic environments.

  1. Press Start testing and allow magnetometer access when prompted by the browser.
  2. Hold your device flat to see the baseline magnetic field strength and compass heading.
  3. Move the device near magnets or metal objects to observe spikes on the realtime chart.
  4. Use Calibrate compass to zero the heading from your current orientation.
  5. Reset when you want to clear the history and begin a fresh capture.

Frequently Asked Questions

A magnetometer measures the strength and direction of the local magnetic field around your device along three orthogonal axes (X, Y, Z). The unit is microteslas (μT) in SI or milligauss (mG) in CGS — 1 μT = 10 mG. Earth's magnetic field at the surface ranges from about 25 μT near the equator to 65 μT near the poles, with a horizontal component of 20–40 μT that gives compasses their direction. Phones use a tiny three-axis Hall-effect or magnetoresistive (AMR/GMR) chip — like the AKM AK0991x or ST LIS3MDL — that resolves field components down to ~0.15 μT. Beyond compass apps, the magnetometer enables AR orientation, metal detection, and tools like this tester.

Magnetometer faults are subtle and usually only show up when compass apps point in the wrong direction or when AR experiences yaw silently. Causes include hard-iron contamination from a phone case with magnets (MagSafe rings, kickstands), proximity to laptop speakers, recalibration corruption after a firmware update, and physical damage to the sensor itself. Testing reveals if all three axes respond, if the total field magnitude matches the expected 25–65 μT range for your location (look up your value at NOAA's magnetic field calculator), and if rotating the phone produces smooth field readings. Indoor steel-frame buildings often distort readings by 20–100 μT, which this tester also helps visualize.

Earth's surface field magnitude varies from 25 μT near the magnetic equator to about 65 μT near the magnetic poles. At a typical mid-latitude location like New York, Madrid, or Tokyo, expect roughly 45–55 μT total magnitude with a horizontal component of 20–25 μT. Indoors, steel structures, electric appliances, and concrete rebar can push readings well outside this range — values of 100–500 μT are common near a fridge or speaker. Strong neodymium magnets can saturate the sensor at 1000+ μT. The reference value for your exact GPS coordinates can be looked up using the World Magnetic Model (WMM2025), updated every five years by NOAA/BGS, and is what calibration apps compare your reading against.

Two effects distort compass headings: hard-iron and soft-iron interference. Hard-iron interference comes from permanent magnets near the sensor (case magnets, MagSafe rings, even some screen protectors) and adds a constant offset to the X/Y/Z readings — your data points in 3D form a sphere displaced from origin. Soft-iron interference comes from ferromagnetic materials (steel beams, refrigerator doors, car frames) that distort the local field and turn that sphere into an ellipsoid. Calibration apps ask you to rotate the phone in a figure-eight pattern to map out the displacement and stretch, then subtract them in software. Re-do calibration whenever you change phone cases, and always test outdoors away from steel buildings for a true reading.

Hard-iron offset shifts each axis by a constant — if a small magnet sits 1 cm from the sensor, you might see +30 μT on X regardless of orientation. The fix is bias estimation: collect samples while rotating the phone in all directions, compute the center of the resulting point cloud, and subtract those values from every future reading. Soft-iron distortion scales the readings differently along different axes, deforming the calibration sphere into an ellipsoid. The fix is a 3×3 transformation matrix derived by fitting an ellipsoid to the data and inverting it. Modern phones run this calibration continuously in the background, but rapid environmental changes (entering a car, picking up a magnetic case) require a fresh figure-eight motion to re-anchor the offsets.

The World Magnetic Model (WMM2025, currently valid through 2029) is a mathematical description of Earth's main magnetic field, updated every five years by NOAA's National Centers for Environmental Information and the British Geological Survey. It tells you the expected field strength, declination (the angle between magnetic north and true north), and inclination at any latitude/longitude/altitude on Earth. Phones use the WMM to convert raw magnetometer readings into true compass headings — without it, a compass pointing to magnetic north would be off by up to 30° in some regions. Declination drifts ~0.1° per year, which is why the model needs periodic updates. You can look up your local declination at the NOAA Magnetic Field Calculator.

Two APIs are involved. The legacy DeviceOrientationEvent fires alpha values that are fused with magnetometer data to produce a compass heading in degrees — this works on iOS Safari (with permission) and Android Chromium. The newer Generic Sensor API exposes Magnetometer and AbsoluteOrientationSensor classes that return raw μT values per axis along with a calibration accuracy indicator (LOW/MEDIUM/HIGH). Generic Sensor is currently supported on Chromium-based browsers behind a flag and via the Sensor permission. On iOS, raw magnetometer access is not exposed to the web — only the fused compass heading from DeviceOrientationEvent.webkitCompassHeading. This tool detects available APIs and falls back gracefully.

Consumer three-axis magnetometers (AKM AK0991x, ST LIS3MDL, Memsic MMC5983) are characterized by full-scale range (±1300 μT to ±4900 μT typical), resolution (0.15–0.6 μT/LSB), noise density (0.3–1.5 μT RMS), and zero-field offset stability over temperature. ISO 12000 covers magnetic field measurement procedures, and IEEE 1451.4 standardizes the smart-sensor interface. The reference field model is the WMM2025 maintained by NOAA/BGS, against which all consumer compasses are calibrated. For comparison, scientific-grade fluxgate magnetometers used by geophysicists reach 0.01 nT resolution — about 15,000 times more sensitive than a phone — but cost thousands of dollars. For consumer use, phone magnetometers easily meet the IATA aviation compass accuracy spec of ±5° heading.
Magnetometer Tester — Measure ambient magnetic field strength in microteslas and view a live compass needle. Start the magnetometer, chart rea
Magnetometer Tester