More games at WuGames.ioSponsoredDiscover free browser games — play instantly, no download, no sign-up.Play

Digital Compass

Free online digital compass using your phone's magnetometer. Read the magnetic heading, record a session with min/max/jitter stats and export CSV or JSON.

Idle
N
NE
E
SE
S
SW
W
NW
N
Info Heading & session stats
Magnetic heading:--
Min heading:--
Max heading:--
Average (circular):--
Jitter (peak-to-peak):--
Samples recorded:0
Guide Usage guide
  • Tap 'Start compass' and grant sensor permissions when prompted (the page must be served over HTTPS).
  • Hold your device flat and away from metal objects or magnets.
  • If the heading is jumpy, calibrate by moving your device in a figure-8 pattern.
  • The red needle always points to magnetic north (0°=N, 90°=E, 180°=S, 270°=W).
  • Use 'Export CSV' or 'Export JSON' to save the recorded session for a test report.

Digital Compass - Online Magnetometer Heading Tester

The Digital Compass is a free, browser-based tool that reads your device's built-in magnetometer through the Web DeviceOrientation API to determine magnetic north and display your current heading in real-time.

Built for QA labs and repair technicians as well as everyday navigation, it records every heading sample while running and shows live session statistics — minimum, maximum, circular-mean average, and peak-to-peak jitter — so you can immediately see whether a magnetometer is stable, noisy, or stuck. The full session can be exported as CSV or JSON and attached to a pass/fail test record.

Useful for:
• Magnetometer / orientation-sensor bring-up and QA testing
• Navigation and wayfinding while traveling
• Hiking, mountaineering, and trekking
• Camping and outdoor activities
• Construction alignment and feng shui
• Geography and science education

No app installation needed, works directly in the browser. All sensor data stays on your device — nothing is uploaded.

Key Features

  • Real-time magnetic heading display (0-360°) read directly from the device magnetometer
  • Visual compass rose with 8 cardinal directions: N, NE, E, SE, S, SW, W, NW
  • Shortest-path needle rotation so the rose never spins the long way at the 0/360 boundary
  • Live session recorder: every heading sample is captured while running
  • Session statistics — min, max, circular-mean average, and peak-to-peak jitter
  • Export the recorded session as CSV or JSON for test reports
  • Detailed degree markings every 5° with major marks every 30°
  • Fullscreen mode for convenient outdoor use
  • Honest feature detection: clear message on desktop, insecure (HTTP) context, or when no sensor data arrives
  • Multi-language support (English, Spanish, Vietnamese, Portuguese, French)
  • Compatible with most smartphones and tablets that expose a magnetometer to the browser

Tips for Most Accurate Results

  • Keep your device flat and parallel to the ground (not tilted) — tilt couples into heading error
  • Move away from electronics (computers, speakers, TVs), large metal objects and magnets
  • If the heading is jumpy or wrong, calibrate by rotating the device in a figure-8 motion in the air
  • Note: magnetic north differs from true geographic north (declination can vary 0-20° by location); this tool reports magnetic heading
  • Record a short session and check the jitter value — a low peak-to-peak spread indicates a stable sensor
  • Remove magnetic interference sources like bracelets or magnetic watches before use
  • On iOS 13+, remember to grant 'Motion & Orientation' permission when requested
  • Accuracy depends on your device's magnetometer sensor quality
Digital Compass — Free online digital compass using your phone's magnetometer. Read the magnetic heading, record a session with min/max/ji
Digital Compass

FAQ - Frequently Asked Questions

A digital compass uses the magnetometer (magnetic field sensor) built into smartphones/tablets to measure Earth's magnetic field. The browser exposes this through the DeviceOrientation API, which the OS fuses with the accelerometer and gyroscope to compute a heading relative to magnetic north.

Chrome on Android: yes (fires the deviceorientationabsolute event). Safari on iOS 13+: yes, but you must tap Start and grant the 'Motion & Orientation' permission prompt. Desktop and laptop browsers: generally NO — most have no magnetometer, so the tool will report that no orientation data was received. The page must also be served over HTTPS; the sensor is blocked on insecure (HTTP) connections.

Desktops and most laptops do not have a magnetometer, so the browser never sends a heading. After you press Start, the tool waits briefly and then shows a 'no orientation data received' message instead of silently doing nothing. Use a phone or tablet for a working compass.

The heading is shown in degrees from 0 to 360, measured clockwise from magnetic north: 0° = North, 90° = East, 180° = South, 270° = West. The labelled direction below (e.g. NE) is the nearest of the 8 cardinal/intercardinal directions.

While the compass runs it records every heading reading. Min and Max are the lowest and highest headings seen. Average uses a circular mean (averaging the sine and cosine) so readings near the 359/0 boundary average correctly instead of jumping to ~180°. Jitter is the peak-to-peak spread (max − min): a small value means a stable sensor, a large value means a noisy or interfered reading. Export CSV/JSON to attach the raw samples and stats to a test report.

No. This tool does not request your GPS location, and all orientation/heading processing happens locally in your browser. Recorded samples are only written to a file when you click Export, and that file is saved directly to your own device — nothing is uploaded to any server.

To access device orientation, the browser requires user permission (especially on iOS 13+, where you must respond to a prompt after tapping Start). This is a browser security measure. No data is sent or stored remotely.

Magnetic north is where compass needles point — the magnetic North Pole. True north is the direction to the geographic North Pole. The difference is called magnetic declination, which can range from 0-20° by location. This tool reports the raw magnetic heading; it does not apply declination correction.

Frequently Asked Questions

The Digital Compass reads your device's magnetometer through the Web DeviceOrientation API (or the modern AbsoluteOrientationSensor) and computes your heading relative to magnetic north. It displays the bearing in degrees from 0 to 360 (N=0°, E=90°, S=180°, W=270°), plus an arrow rotated to show where magnetic north lies relative to the device's top edge. When GPS is also available, the tool can optionally show GPS coordinates and apply a magnetic declination correction so the heading reflects true (geographic) north rather than magnetic north. The DeviceOrientation API combines magnetometer with accelerometer and gyroscope through OS-level sensor fusion, producing a smooth heading that updates at 30–60 Hz.

Phones have largely replaced standalone magnetic compasses for everyday navigation: hiking off-trail, geocaching, sailing, surveying property lines, orienting solar panels or satellite dishes, aligning architectural features, finding qibla direction for prayer, and even helping in emergency situations where you need to walk in a fixed direction. Compared to a needle compass, the phone version adds GPS location, automatic declination correction, the ability to log a track of bearings over time, and integration with mapping apps that show your heading on the map. Limitations are real — phones can fail at high latitudes, near metal, in strong magnetic interference, or during electrical storms. A small backup magnetic compass remains good practice for serious wilderness use.

Best case for a well-calibrated phone far from metal in normal magnetic conditions: ±3° to ±5° from true north after declination correction. This is enough to find a peak 5 km away within ±400 m or a landmark across town within a few blocks. Realistic indoor use: ±10° to ±30° due to building steel, electronics, and lack of opportunity to calibrate. Near steel buildings, cars, or power lines, errors can spike to 90° or more — the compass may even flip. Compare to a quality marine sighting compass (Suunto MC-2, Brunton 8099) which delivers ±1° to ±2° in skilled hands. Phone accuracy is good enough for the majority of outdoor navigation but not for serious surveying. Always cross-check critical bearings against another reference.

Drift comes from the gyroscope integration in sensor fusion — over seconds to minutes, small errors accumulate and the heading slowly rotates away from the true value until the magnetometer correction pulls it back. You'll see this as the arrow smoothly turning even though you're not. Freezing happens when the magnetometer cannot get a usable reading — usually because you're inside a vehicle, in a basement with rebar walls, or surrounded by electronics that overwhelm the small Earth field signal. The fusion algorithm tries to fall back on gyroscope-only mode but eventually gives up and reports a stuck heading. Solutions: get clear of metal, hold the phone level and away from your body, perform a figure-8 calibration motion, or restart the compass app.

These three differ at most places on Earth. Magnetic north is where your compass points — a moving location currently in the Canadian Arctic that drifts about 60 km per year. True north (geographic north) is the rotational axis pole at 90°N. Grid north is the direction "up" on whatever map projection you are using — at the equator it equals true north, but UTM zones use a grid that tilts away from true north by up to 3° near zone boundaries. The angle from magnetic to true is called declination and varies from about −20° in the western US to +15° in eastern Europe; declination at any location and date is given by the World Magnetic Model (WMM2025 is current). Phone compass apps usually apply automatic declination correction if GPS is available, displaying true bearing by default.

The heading calculation requires knowing which way is "down" so the magnetometer can be projected onto the horizontal plane. When you hold the phone flat in your palm, the accelerometer reports gravity along the Z axis, and the calculation is straightforward. When you tilt the phone toward vertical, the projection becomes mathematically sensitive — tilt errors couple into heading errors with a multiplier of 1/cos(tilt). At 80° tilt (nearly vertical), a 1° tilt error becomes 6° heading error. Most phones use a quaternion-based fusion that handles tilt correctly up to about 75°, beyond which they fall back to a simpler 2D calculation that becomes unstable. For best results, hold the phone horizontal or use a marine-style "sighting compass" mode if your app provides one.

These are two completely different measurements. Magnetometer heading is your facing direction — where the phone's top edge points. GPS heading is your direction of motion derived from successive position fixes — where you are moving, regardless of which way the phone faces. When walking forward, the two should roughly agree, though GPS lags by 1–3 seconds. When standing still, GPS heading is undefined (no motion, no heading), and most apps either freeze the last value or report NaN. When you face one direction while sidestepping in another, only the magnetometer captures your face direction. For navigation, magnetometer heading is normally what you want; for vehicle navigation, GPS heading is more reliable because car-mounted phones often have heavy magnetic interference. Some apps switch automatically based on speed.

The reference standards are MIL-STD-1949 (military magnetic compass requirements, ±2° accuracy), ISO 25862 for marine compasses (±1°), and FAA TSO-C-46a for aviation compasses (±10° after calibration). These apply to dedicated mechanical and electronic compasses, not phones. Phone magnetometers themselves meet sensor-level standards like the JIS C 1602 for magnetometer accuracy, but the heading accuracy is limited by calibration drift and environmental magnetic interference rather than the chip's intrinsic capability. The Web DeviceOrientation API and AbsoluteOrientationSensor are governed by W3C drafts, with the OS providing sensor fusion implementations using Apple A-series motion coprocessor (iOS) or Qualcomm Sensor Hub (Android). Declination calculations use the World Magnetic Model (WMM) which is updated jointly by NOAA and the British Geological Survey every 5 years.