Blog

Compass heading drifts after changing browsers?

Find out whether compass drift comes from browser permissions, magnetic interference, or the phone itself, then compare readings and fix the cause.

Jason TurnerHardware tests 5 min read

Your phone showed one compass heading in a browser, then a different or wandering heading after you switched browsers. That does not automatically mean the compass is broken. Browsers can use different sensor interfaces, and nearby metal or a missing permission can affect what the page receives.

Use the Sensors Test on the phone or tablet itself. It can show compass and motion readings so you can compare how the heading changes as you turn the device. This helps separate a browser difference from a sensor problem.

Compare compass readings in both browsers

  1. Open the Sensors Test on the phone or tablet in the first browser. If asked, allow access to motion or orientation sensors.
  2. Find the compass reading. Set the device flat, away from a laptop, metal desk, speaker, magnetic case, or car mount. Keep the test open and note the heading.
  3. Turn the device slowly through a full circle while keeping it level. Notice whether the reading changes smoothly, jumps, or stays still. Avoid judging the exact direction until the device has settled.
  4. Repeat the same test in the other browser, in the same place and with the same phone position. Allow sensor access there too. Compare the direction of change, not just the first number.
  5. If one browser seems wrong, return to the first browser and repeat the movement. This checks whether the result follows the browser or changes with the room, position, or device.

A browser test can show the sensor data available to that page. It cannot recalibrate the phone's compass or prove that the displayed heading is survey-grade accurate.

What the result means

The heading changes smoothly in both browsers

The compass sensor is responding. A small difference in the numbers can come from how each browser or operating system reports orientation. If the readings are steady after you stop moving, the difference may not affect ordinary navigation. Compare against a map or compass app only after moving away from magnetic objects.

The heading is steady in one browser but jumps in the other

The phone may be fine, while the second browser has a different permission state, sensor support, or implementation. Check that browser's site permissions and update it. A browser that does not support the relevant sensor may show no useful compass data, even if another browser does.

The heading jumps in both browsers in one place

Look for local interference before blaming the phone. Metal furniture, a magnetic phone case, a speaker, a charging accessory, or a vehicle can disturb the magnetic field. Move several feet away and repeat the same slow turn.

The reading stays still or is unavailable in both browsers

The browser may not have sensor permission, the device may not expose a compass sensor to web pages, or the sensor may have a fault. Test in a regular browser tab, check the device's sensor permissions, and compare with a built-in compass app if available.

How to fix compass drift

  1. Move away from magnetic objects. Take off a magnetic case or wallet and move away from speakers, metal furniture, charging stands, and car mounts. Keep the device flat while you test, then turn it slowly.
  2. Allow sensor access for the site. If the browser asked for motion or orientation access, choose Allow. If you denied it earlier, open the browser's site permissions for TooLab and change the sensor permission if that option is available. Reload the page and test again.
  3. Check the phone's sensor access. On Android, open Settings › Apps › your browser › Permissions and review any motion or physical activity permission listed there. Browser versions differ, so also check the browser's site settings for a Motion sensors permission. On iPhone or iPad, check Settings › Apps › Safari › Motion & Orientation Access if that setting appears. On older iOS versions, look under Settings › Safari. Other iOS browsers may have their own site permission prompt.
  4. Check location access only if you are testing location too. Location permission and compass access are not the same thing. On Android, review Settings › Location › App location permissions. On iPhone or iPad, review Settings › Privacy & Security › Location Services. These settings affect location readings, not necessarily compass orientation.
  5. Restart the browser and device. Close the browser fully, reopen it, and repeat the test. If both browsers still behave the same way, restart the phone to clear a stuck sensor session.
  6. Update the browser and operating system. Install available updates, then test again in both browsers. If the problem began immediately after an update, record the browser versions and whether the other browser still reads the sensor consistently.

A Windows 11 PC or Mac usually does not have a compass sensor that a browser can read. Their location settings, Settings › Privacy & security › Location on Windows 11 and System Settings › Privacy & Security › Location Services on macOS, control location access, not compass heading. Run this comparison on the phone or tablet whose compass is drifting.

Why changing browsers can change the reading

A compass heading is not just a number delivered identically by every browser. The operating system and browser determine which sensor data a web page can access, and a page may receive different orientation information depending on the browser. Some readings describe how the device is tilted or turned, while a compass heading represents direction relative to the magnetic field. These values are related, but they are not interchangeable.

Also, magnetic north and true north are not exactly the same direction. For a practical check, focus on whether the heading responds smoothly and consistently when you turn the device in the same location. For more on conditions that affect a phone compass, see how to test an inaccurate phone compass.

The Sensors Test reads the device's sensor data in your browser. Sensor readings stay on your device.