Web Bluetooth API
The Web Bluetooth API is a browser API that lets web pages discover and communicate directly with nearby Bluetooth Low Energy (BLE) devices, after explicit user consent, without requiring a native app or driver.
Definition
The Web Bluetooth API is a browser API that lets web pages discover and communicate directly with nearby Bluetooth Low Energy (BLE) devices, after explicit user consent, without requiring a native app or driver.
Overview
Historically, interacting with hardware like fitness trackers, IoT sensors, or custom BLE peripherals from a browser required a native companion application. The Web Bluetooth API removes that requirement by exposing a JavaScript interface, `navigator.bluetooth`, that can scan for BLE devices advertising specific services, request a user-approved connection, and then read or write GATT (Generic Attribute Profile) characteristics — the standard data model BLE devices use to expose readable and writable values such as heart rate, battery level, or custom sensor data. A typical flow starts with `navigator.bluetooth.requestDevice()`, which triggers a native browser device-picker UI listing nearby devices matching filters the page specifies (such as a service UUID). The user must explicitly select a device; a page cannot silently enumerate or connect to devices in the background. Once connected via `device.gatt.connect()`, the page can access GATT services and characteristics to read sensor values, subscribe to notifications for streaming updates, or write commands back to the device. Web Bluetooth is scoped tightly for security and privacy: it requires a secure context (HTTPS), a user gesture to initiate the device chooser, and per-origin permission that the user can revoke. It does not expose classic Bluetooth (BR/EDR) profiles like audio streaming, only Bluetooth Low Energy. Browser support is uneven — Chrome, Edge, and Opera support it on desktop and Android, but Firefox and Safari have not shipped it, citing security and fingerprinting concerns, which limits Web Bluetooth to Chromium-based deployments and makes it best suited for internal tools, kiosks, or controlled environments rather than mass-market consumer sites.
Specification
- Connects web pages directly to Bluetooth Low Energy (BLE) devices
- Requires a user gesture and native device-picker UI for each connection
- Exposes GATT services and characteristics for reading, writing, and notifications
- Requires a secure context (HTTPS)
- Only supports BLE, not classic Bluetooth audio/profile use
- Per-origin permission model that users can revoke
- Not supported in Firefox or Safari as of general availability
- Commonly used with device filters to scope which devices appear in the picker
Use Cases
Alternatives
History
The Web Bluetooth API lets web pages discover and communicate with nearby Bluetooth Low Energy (BLE) devices directly from JavaScript, without a native app or plug-in. A site calls navigator.bluetooth.requestDevice(), and the browser shows a standard chooser so the user explicitly selects which device to connect to; the page can then read and write GATT characteristics, receive notifications, and detect disconnects. Championed largely by Google's Chrome team, a subset of the API has been available in Chrome across platforms — ChromeOS, Chrome for Android 6.0, macOS (Chrome 56), and Windows 10 (Chrome 70). For safety, Web Bluetooth is restricted to secure contexts and gated behind explicit user permission, and connections cannot silently persist across page reloads.
Sources
- Chrome for Developers — Communicating with Bluetooth devices over JavaScript · as of 2026-07-17
- MDN Web Docs — Web Bluetooth API · as of 2026-07-17