What Is a UUID and How Does It Work?
A UUID (Universally Unique Identifier) is a 128-bit value used to label things uniquely without a central authority. You've seen them as strings like 550e8400-e29b-41d4-a716-446655440000.
The format
A UUID is 32 hexadecimal digits in five dash-separated groups (8-4-4-4-12):
550e8400-e29b-41d4-a716-446655440000
That's 128 bits, usually written as 36 characters including the dashes.
How can they be "unique" without coordination?
The magic is probability. A random (v4) UUID has 122 random bits — about 5.3 × 10³⁶ possibilities. The chance of generating two the same is so astronomically small that, in practice, collisions never happen. No central server needs to hand them out.
Why use them
- Distributed systems — every node can mint IDs independently with no collisions.
- Database keys — generate the ID before inserting, no round-trip for an auto-increment.
- Idempotency keys, request IDs, file names — anywhere you need a unique handle.
Trade-offs vs auto-increment integers
- UUIDs are larger (16 bytes vs 4–8) and not sequential, which can hurt database index locality.
- Newer versions like v7 add a time component to restore sortability — see UUID versions explained.
Generate one
Create UUIDs instantly with the UUID generator — no two will ever clash.
Got a config file to check?
Open the config toolkit →