Complete User Guide to Device Sensors, Accelerometer, Gyroscope & Orientation APIs
How Accelerometers, Gyroscopes, and Orientation Angles Work in Browsers
Smartphones, tablets, and certain hybrid laptops contain Micro-Electro-Mechanical Systems (MEMS) motion sensors that web pages can read through the DeviceMotion and DeviceOrientation browser APIs when served over a secure context and permitted by the browser. An accelerometer measures acceleration in meters per second squared (m/s²) along three axes (X left-to-right across the screen, Y bottom-to-top along the screen, and Z perpendicular out of the screen)—including Earth's gravity (~9.81 m/s²) when resting flat or upright. A gyroscope measures angular rotation rate (α, β, γ in degrees per second) around those axes, while orientation reports device rotation and tilt angles (alpha, beta front-to-back tilt, and gamma left-to-right roll). A browser-based Device Sensor Inspector reads sensor frames 100% locally in your browser—with zero server uploads.
How to Inspect Your Device Sensors in 3 Easy Steps
- Open on a Sensor-Equipped Device & Tap Enable Sensors: Tap Enable Sensors (required on iOS Safari and certain browsers to request motion/orientation permission), or click Simulate Tilt Preview on a desktop browser to test the live bubble and readout pipeline.
- Tilt or Rotate Your Device Gently: Watch the bubble indicator, gravity acceleration (
m/s²), gyroscope rotation rate, and orientation angles respond in real time. - Pause or Export Your Sensor Snapshot: Click Pause to freeze a reading, then export via Copy Sensor Snapshot or Download .txt.
Acceleration Magnitude & Gravity Reference Formula
Combining three-axis acceleration components (ax, ay, az) gives total acceleration magnitude:
Helpful Tips When Testing Sensors on Mobile & Desktop
- Desktop PCs Often Lack Motion Sensors: Most desktop computers and many laptops do not have an accelerometer or gyroscope—if no real hardware events arrive, use Simulate Tilt Preview to preview how the visualizer and report formatter behave.
- Check Browser Motion & Orientation Permissions: If iOS Safari or an Android browser blocks motion events, verify that motion/orientation access is allowed in browser or device settings.
- Hold Device Firmly When Tilting: Avoid rapid jerky movements near tables or hard edges while testing tilt and rotation.
Worked Example: A smartphone resting face-up flat on a table experiences roughly 0 m/s² on X and Y and about +9.81 m/s² (~1.00 g) along the vertical Z axis due to Earth's gravity.