What Is a UUID? Versions, Format, and Uses Explained
A UUID (Universally Unique Identifier) is a 128-bit value used to uniquely label data without a central authority. It's written as 32 hexadecimal digits in five hyphen-separated groups (8-4-4-4-12), like 550e8400-e29b-41d4-a716-446655440000. Two independently generated UUIDs are, for all practical purposes, guaranteed never to collide.
UUIDs are everywhere — database keys, API resources, file names, distributed systems. Here's how they work.
The 8-4-4-4-12 Format
A UUID is 128 bits shown as 32 hex characters in this fixed layout:
550e8400-e29b-41d4-a716-446655440000
8 - 4 - 4 - 4 - 12
Two characters carry meaning:
- The version digit (start of the 3rd group) —
4above — says how the UUID was generated. - The variant bits (start of the 4th group) —
aabove — identify the UUID layout standard.
Generate one instantly with our UUID Generator.
UUID Versions (and When to Use Each)
| Version | How it's generated | Best for |
|---|---|---|
| v1 | Timestamp + MAC address | Time-ordered IDs (leaks MAC/time) |
| v4 | Random | General-purpose — the default |
| v7 | Timestamp + random | Database keys that sort by creation time |
- v4 is the workhorse: 122 random bits, no metadata leakage, ideal almost everywhere.
- v7 is the modern favorite for database primary keys because it's time-sortable, which keeps index inserts efficient. See UUID v4 vs UUID v7 for the trade-offs.
What UUIDs Are Used For
- Database primary keys — generate IDs on any node without coordinating with a central sequence.
- Distributed systems — merge data from many sources without key collisions.
- API resource IDs — expose
/users/550e8400-...instead of guessable sequential IDs. - Idempotency keys, file names, request tracing — anywhere you need a unique, opaque label.
UUIDs vs auto-increment integers: UUIDs avoid central coordination and don't leak row counts, at the cost of more storage and (for v4) random insert order.
Are UUIDs Truly Unique?
Not mathematically guaranteed — but the collision probability is so small it's effectively zero. A v4 UUID has 122 random bits (~5.3×10³⁶ values). You'd need to generate billions per second for ~85 years to reach a 50% chance of a single collision. For real systems, treat them as unique.
UUID vs GUID
You'll see GUID (Globally Unique Identifier) used interchangeably — it's Microsoft's name for the same 128-bit identifier. Our UUID Generator produces values in this exact format (usable as a GUID too), and see GUID vs UUID for the (minor) differences.
Frequently Asked Questions
What is a UUID? A 128-bit universally unique identifier, written as 32 hex digits in an 8-4-4-4-12 pattern, used to label data without a central authority.
What does UUID stand for? Universally Unique Identifier.
What is a UUID used for? Database keys, API resource IDs, distributed-system identifiers, file names, and request tracing — anywhere uniqueness without coordination matters.
What does a UUID look like?
Five groups of hex digits separated by hyphens, e.g. 550e8400-e29b-41d4-a716-446655440000.
Are UUIDs truly unique? Not guaranteed, but the collision odds are astronomically small — for practical purposes they're unique.
Related Reading
A UUID is a globally unique label you can mint anywhere, instantly, with no coordination — which is exactly why distributed systems and databases lean on them so heavily.