Service UUID: what it is, format and where it is used

Author: IT Sectr Published: 2026-07-14 Reading time: 8 min

Service UUID is a unique 16- or 128-bit Bluetooth Low Energy (BLE) identifier that uniquely defines a functional service on a device. Bluetooth SIG has allocated standard 16-bit UUIDs for common services such as Battery Service (0x180F), Device Information (0x180A) and Heart Rate (0x180D), simplifying cross-platform compatibility. According to the Bluetooth Core Specification 5.4 (2023), custom services by third-party developers must use 128-bit UUIDs, the format of which guarantees global uniqueness without a central registry. Proper declaration of Service UUID is the first step toward correct operation of the GATT server on a peripheral device.

Key Takeaways

  • Service UUID is a BLE service identifier that can be 16-bit (standard) or 128-bit (custom).
  • Bluetooth SIG has allocated more than 60 standard UUIDs for common services — Battery, Heart Rate, Device Information and others.
  • 128-bit UUIDs are generated by the developer and guarantee global uniqueness of the service without registration with a central authority.
  • When scanning, the Central detects Peripheral services by their Service UUID, which determines device compatibility.
  • A single GATT server can declare multiple services with different UUIDs — each service contains its own characteristics.

What is Service UUID in BLE?

Service UUID is an identifier assigned to a Bluetooth Low Energy GATT service for its unambiguous recognition by other devices. In BLE architecture, each service represents a logical group of characteristics united by a common function. For example, the Battery Service contains the Battery Level characteristic, which transmits the current battery charge.

Bluetooth SIG (Special Interest Group) manages the registry of standard 16-bit UUIDs assigned to the most common services. This allows devices from different manufacturers to recognize each other's services without prior configuration. A fitness tracker from any brand can declare a Heart Rate Service with UUID 0x180D, and any smartphone will understand that this is a heart rate service.

According to Bluetooth Core Specification 5.4 (2023), the 16-bit UUID range (0x0000–0xFFFF) is divided into two parts: 0x0001 to 0xFFFE are standard Bluetooth SIG services, and 0xFFFF is reserved. If a developer needs a unique service that is not in the SIG registry, they use a 128-bit UUID.

The difference between standard and custom UUIDs is not only in length: 16-bit UUIDs save air time in the advertising packet, as they are transmitted as 2 bytes instead of 16 bytes. For devices with tight advertising packet size constraints (up to 31 bytes), this is critical.

Standard and Custom UUIDs

Standard 16-bit UUIDs cover the main categories of BLE devices: medical sensors, fitness trackers, wearable electronics and accessories. If a device implements a standard function, the developer is recommended to use the corresponding UUID from the Bluetooth SIG registry for maximum compatibility.

Here are a few examples of standard service UUIDs:

UUID (hex)Service NamePurpose
0x1800Generic AccessAccess control, device name, appearance
0x180ADevice InformationManufacturer, model, serial number, firmware version
0x180DHeart RateHeart rate measurement, sensor location, battery power
0x180FBattery ServiceBattery charge level in percent
0x181AEnvironmental SensingTemperature, humidity, pressure, illuminance
0x181CUser DataAge, weight, height, gender, resting heart rate

Custom 128-bit UUIDs are necessary when a device provides unique functionality. For example, a smart lock manufacturer creates their own Lock Control service with a UUID like XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX. Such a UUID is guaranteed not to conflict with other services, since the 128-bit value space is practically inexhaustible.

128-bit UUID Format

A 128-bit UUID is written in the standard UUID format per RFC 4122: eight hexadecimal characters, a hyphen, four, hyphen, four, hyphen, four, hyphen, twelve characters. For BLE, a version is used where the base part of the Bluetooth SIG UUID has fixed bits.

Bluetooth SIG defines the base UUID: 0000XXXX-0000-1000-8000-00805F9B34FB. For standard 16-bit services, the UUID value is substituted into this mask: for example, 0x180F becomes 0000180F-0000-1000-8000-00805F9B34FB. Custom services use a completely independent UUID generated by the developer.

When creating a custom UUID, you can use any UUID generator (UUID v4). A random UUID v4 provides 122 bits of entropy, making collisions practically impossible. Do not use a modified version of the base Bluetooth SIG UUID for custom services — this violates the specification.

How to Declare a Service with UUID in Code

Declaring a service with a UUID is done on the Peripheral side when creating a GATT server. In iOS, Core Bluetooth is used; in Android, android.bluetooth.le. Let us look at both approaches.

iOS: Core Bluetooth

In Swift, a service is created via CBMutableService specifying the UUID, after which characteristics are added to it via CBMutableCharacteristic.

swift
import CoreBluetooth

// Standard 16-bit UUID
let batteryServiceUUID = CBUUID("180F")

// Custom 128-bit UUID
let customServiceUUID = CBUUID("E20A39F4-73F5-4BC4-A12F-17D1AD07A961")

let service = CBMutableService(
    type: customServiceUUID,
    primary: true
)

// Add characteristics
service.characteristics = [characteristic]

// Publish service via peripheralManager
peripheralManager.add(service)

Android: Bluetooth GATT Server

On Android, the service is registered via BluetoothGattServer and BluetoothGattService. The UUID is passed as a string via java.util.UUID.fromString.

java
import android.bluetooth.*;

// Custom service UUID
private static final UUID CUSTOM_SERVICE_UUID =
    UUID.fromString("E20A39F4-73F5-4BC4-A12F-17D1AD07A961");

BluetoothGattService service = new BluetoothGattService(
    CUSTOM_SERVICE_UUID,
    BluetoothGattService.SERVICE_TYPE_PRIMARY
);

// Add characteristics
service.addCharacteristic(characteristic);

// Register on GATT server
gattServer.addService(service);

Scanning Services by UUID

Scanning by Service UUID allows the Central to find devices that provide the needed service without connecting to all discovered Peripherals. A BLE advertising packet can contain a list of service UUIDs, allowing the Central to filter devices at the scanning stage.

In iOS, CBCentralManager scans for devices with a filter by service UUID. This reduces power consumption and speeds up discovery of needed devices.

swift
import CoreBluetooth

let centralManager = CBCentralManager()

func scanForHeartRateMonitor() {
    let services: [CBUUID] = [
        CBUUID("180D") // Heart Rate Service
    ]
    centralManager.scanForPeripherals(
        withServices: services,
        options: nil
    )
}

// Delegate receives only Heart Rate Service devices
func centralManager(
    _ central: CBCentralManager,
    didDiscover peripheral: CBPeripheral,
    advertisementData: [String: Any],
    rssi RSSI: NSNumber
) {
    // peripheral has only devices with UUID 0x180D
}

On Android, filtering by UUID is also supported via ScanFilter.Builder. This is an efficient way to narrow the search without connecting to each device.

java
import android.bluetooth.le.*;

ScanFilter filter = new ScanFilter.Builder()
    .setServiceUuid(
        new ParcelUuid(
            UUID.fromString("0000180D-0000-1000-8000-00805F9B34FB")
        )
    )
    .build();

BluetoothLeScanner scanner = bluetoothAdapter.getBluetoothLeScanner();
scanner.startScan(
    Collections.singletonList(filter),
    scanSettings,
    scanCallback
);

Multiple Services on One Device

A single BLE device can declare multiple services simultaneously. For example, a fitness bracelet may contain Battery Service (0x180F), Heart Rate Service (0x180D) and a custom service for syncing data with the cloud. Each service has its own UUID and its own set of characteristics.

With multiple services, it is important to consider the advertising packet limitation. A BLE advertising packet can contain up to 31 bytes of data. If service UUIDs take up too much space, some may not fit in the advertising packet. In this case, scan response is used — a second packet sent upon Central request.

According to Bluetooth Core Specification 5.4 (2023), the maximum number of primary services on a single GATT server is not limited by the specification, but in practice it is limited by device memory and performance requirements. For embedded devices with 256 KB flash memory, no more than 5–10 services are recommended.

Frequently Asked Questions

How does a 16-bit UUID differ from a 128-bit UUID?

16-bit UUIDs are reserved by Bluetooth SIG for standard services and occupy 2 bytes in the advertising packet. 128-bit UUIDs are used for custom services and occupy 16 bytes. The choice depends on the service type: standard functionality uses a 16-bit UUID, unique functionality uses a 128-bit UUID.

How to generate a custom 128-bit UUID for a BLE service?

Use UUID v4 — a random UUID generated by online tools, the uuidgen terminal command, or your programming language API. Example: UUID.fromString(UUID.randomUUID().toString()) in Java or UUID() in Swift.

Is it necessary to register a custom UUID with Bluetooth SIG?

No, registration is not required. Bluetooth SIG only registers 16-bit UUIDs. Custom 128-bit UUIDs are generated by the developer independently and guarantee uniqueness through the vast address space (2^128 combinations).

Can a single service contain multiple characteristics?

Yes, a standard GATT service can contain an unlimited number of characteristics. For example, Battery Service can contain Battery Level (0x2A19) and Battery Power State (0x2A1A). Each characteristic has its own UUID and set of properties.

What happens if two devices use the same custom UUID?

If the UUIDs match, the Central cannot distinguish one service from another without additional information. The probability of collision with random UUID v4 is negligibly small — approximately 5.3 × 10^−37. Use a random UUID generator, do not copy UUIDs from examples.

Summary

  • Service UUID is a global BLE service identifier that can be 16-bit (standard) or 128-bit (custom).
  • Bluetooth SIG has allocated more than 60 standard UUIDs — use them for compatibility with devices from other manufacturers.
  • 128-bit UUIDs are created by the developer via UUID v4 and guarantee uniqueness without a central registry.
  • When scanning, the Central filters devices by Service UUID, which reduces power consumption and speeds up discovery.
  • A single device can declare multiple services with different UUIDs — the number is limited by memory and the advertising packet.
  • In iOS and Android, services are declared via CBMutableService and BluetoothGattService respectively, specifying the UUID.
  • Proper UUID selection affects compatibility, advertising packet size, and correct GATT profile operation.

We will develop a mobile application turnkey

IT Sectr creates iOS and Android applications for startups and businesses since 2017. We will advise you and propose the best solution.

Discuss the project

Read also