The version-4 format
The most common flavour, UUID v4, is randomly generated with a fixed pattern:
xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx8-4-4-4-12 hex digits · the 4 marks version 4 · y is 8, 9, a or b (the variant)
Other versions exist: v1 embeds a timestamp and MAC address, v3/v5 derive from a namespace plus a name (MD5/SHA-1), and v7 — increasingly popular — is time-ordered for database-friendly sorting.
Why collisions basically never happen
A v4 UUID carries 122 random bits, giving about 5.3 × 10³⁶ possible values. To grasp that: you could generate a billion UUIDs per second for a century and your chance of a single collision would still be vanishingly small. This is what makes UUIDs safe for distributed systems — thousands of servers can create IDs simultaneously without ever asking a central authority "is this one taken?"
Where UUIDs show up
- 🗄️ Database primary keys — especially across merged or replicated databases
- 🔑 Session IDs and API tokens — unguessable by design
- 📦 Distributed systems — event IDs, message queues, microservices
- 💾 Filesystems and partitions — your disk's partitions are very likely UUID-identified
❓ UUID FAQs
What does UUID stand for?
Universally Unique Identifier — a 128-bit value written as 32 hex digits in five hyphen-separated groups.
What does a UUID look like?
Like 550e8400-e29b-41d4-a716-446655440000. In v4, the third group's first digit is always 4.
Can two UUIDs be the same?
Theoretically yes, practically no — 122 random bits give ~5.3 × 10³⁶ possibilities, making collisions astronomically unlikely.
What are UUIDs used for?
Database keys, session IDs, distributed systems and APIs — anywhere unique IDs must be created independently.
Related: What Is a QR Code? · What Is Base64? · Free UUID Generator