How to Use the Chrome DevTools Sensors Tab to Spoof Geolocation

Modern web applications frequently rely on hardware sensors, such as GPS, to provide localized content. A weather website needs to know your city, and a delivery service needs to calculate routes from your current position. If you are developing or testing one of these applications, physically traveling to a different country to test the geolocation logic is impossible. To force your desktop browser to mathematically report a fake GPS coordinate, web developers use the Google Chrome DevTools \”Sensors\” tab.

Why Use the Sensors Tab?

When a web application executes the HTML5 Geolocation API (navigator.geolocation.getCurrentPosition), it asks the browser for the device’s current latitude and longitude. By default, Chrome attempts to estimate this based on your IP address or nearby Wi-Fi networks. The Sensors tab allows you to intercept this API call. Instead of returning your real physical location, Chrome will feed the website a hardcoded set of coordinates. This allows you to instantly test how a restaurant locator behaves in London, Tokyo, or New York without ever leaving your desk.

Step 1: Open the Sensors Tab

The Sensors tab is an advanced developer tool and is not visible on the standard DevTools interface.

  1. Open Google Chrome and navigate to the website you wish to test.
  2. Right-click anywhere on the page and select Inspect.
  3. Press the Esc key to open the secondary DevTools Drawer at the bottom of the window.
  4. Click the Three-dot menu icon on the left side of the Drawer.
  5. Select Sensors from the dropdown menu.

Step 2: Spoof Your Location

The Sensors tab provides several built-in cities for quick testing.

  1. Locate the Location dropdown menu in the Sensors tab. By default, it will be set to \”No override\”.
  2. Click the dropdown and select one of the preset cities, such as London or San Francisco.
  3. Alternatively, select Other… and manually type in the exact Latitude and Longitude coordinates you wish to test.

Step 3: Test Error Handling

Robust web applications must degrade gracefully if a user denies location permissions or if the GPS hardware fails. You can simulate this failure state.

  1. In the Location dropdown, select Location unavailable.
  2. Refresh the webpage. When the site attempts to request your location, Chrome will automatically mathematically reject the request, allowing you to test the website’s fallback UI and error messaging.

Step 4: Spoof Device Orientation

For mobile web apps that rely on the gyroscope (such as 3D product viewers or browser-based games), you can also spoof the physical tilt of the device.

  1. Below the Location settings in the Sensors tab, locate the Orientation dropdown.
  2. Select a preset like Portrait upside down or Landscape right.
  3. You can also click and drag the 3D phone model on the screen to generate custom alpha, beta, and gamma rotational values, feeding raw orientation data directly into the web application.

By utilizing the DevTools Sensors tab, developers can rigorously audit geolocation logic and hardware APIs without requiring physical mobile devices or complex VPN routing.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.