Sensors & Location

Gyroscope

Probing…

Gyroscope is a web platform capability in the Sensors & Location category. Angular velocity around three axes. Supported in Chromium 67+; not available in Firefox and Safari. Requires a secure context (HTTPS or localhost) and a user gesture such as a click or tap.

Secure contextUser gesture

Permission gyroscope: unknown

Try it

Loading demo…

Code

const sensor = new Gyroscope({ frequency: 30 })
sensor.addEventListener('reading', () => {
  // angular velocity in rad/s
  console.log(sensor.x, sensor.y, sensor.z)
})
sensor.start()
// later: sensor.stop()

Browser support

Chromium
67
Firefox
No
Safari
No

Frequently asked questions

Which browsers support Gyroscope?

Supported in Chromium 67+; not available in Firefox and Safari.

Does Gyroscope require HTTPS?

Yes. Gyroscope needs a secure context, so it only works over HTTPS (or on localhost during development).

What is Gyroscope used for?

Angular velocity around three axes.

Can I try Gyroscope in my browser?

Yes. shwcs.net runs a live Gyroscope demo that probes your current browser and lets you try the API. Everything runs locally — nothing is sent anywhere.

MDN reference ↗ Specification ↗