W3cubDocs

/Web APIs

BluetoothUUID

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

The BluetoothUUID interface of the Web Bluetooth API provides a way to look up Universally Unique Identifier (UUID) values by name in the registry maintained by the Bluetooth SIG.

Description

A UUID string is a 128-bit UUID, for example 00001818-0000-1000-8000-00805f9b34fb. The Bluetooth registry contains lists of descriptors, services, and characteristics identified by these UUIDs in addition to a 16- or 32- bit alias, and a name.

The BluetoothUUID interface provides methods to retrieve these 128-bit UUIDs.

Static methods

BluetoothUUID.canonicalUUID() Experimental

Returns the 128-bit UUID when passed the 16- or 32-bit UUID alias.

BluetoothUUID.getCharacteristic() Experimental

Returns the 128-bit UUID representing a registered characteristic when passed a name or the 16- or 32-bit UUID alias.

BluetoothUUID.getDescriptor() Experimental

Returns a UUID representing a registered descriptor when passed a name or the 16- or 32-bit UUID alias.

BluetoothUUID.getService() Experimental

Returns a UUID representing a registered service when passed a name or the 16- or 32-bit UUID alias.

Examples

In the following example the UUID representing the service named device_information is returned and printed to the console.

let result = BluetoothUUID.getService("device_information");
console.log(result); // "0000180a-0000-1000-8000-00805f9b34fb"

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS
BluetoothUUID
70Linux support is not enabled by default.
56–70Only supported on macOS.
79Linux support is not enabled by default.
No
57Linux support is not enabled by default.
43–57Only supported on macOS.
No 56 No 43 No 6.0 No No
canonicalUUID_static 56 79 No 43 No 56 No 43 No 6.0 No No
getCharacteristic_static 56 79 No 43 No 56 No 43 No 6.0 No No
getDescriptor_static 56 79 No 43 No 56 No 43 No 6.0 No No
getService_static 56 79 No 43 No 56 No 43 No 6.0 No No

© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/BluetoothUUID