Device Access

Web Bluetooth

Probing…

Web Bluetooth is a web platform capability in the Device Access category. Connect to Bluetooth LE devices and read/write GATT characteristics. Supported in Chromium 56+; 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

Try it

Loading demo…

Code

const device = await navigator.bluetooth.requestDevice({
  acceptAllDevices: true,
  optionalServices: ['battery_service'],
})

const gatt = await device.gatt.connect()
const service = await gatt.getPrimaryService('battery_service')
const characteristic = await service.getCharacteristic('battery_level')
const value = await characteristic.readValue()
console.log('Battery:', value.getUint8(0), '%')

Browser support

Chromium
56
Firefox
No
Safari
No

Frequently asked questions

Which browsers support Web Bluetooth?

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

Does Web Bluetooth require HTTPS?

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

What is Web Bluetooth used for?

Connect to Bluetooth LE devices and read/write GATT characteristics.

Can I try Web Bluetooth in my browser?

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

MDN reference ↗ Specification ↗