What Is a UUID? Versions, Format, and Uses Explained
A UUID (Universally Unique Identifier) is a 128-bit value used to 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. Well-generated UUIDs have a low collision probability, but no UUID version offers a mathematical guarantee of global uniqueness.
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 sequential IDs. Still enforce authorization; a UUID is not an access control mechanism. - 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. A v4 UUID has 122 random bits (~5.3×10³⁶ possible random values), so collisions are unlikely when generated with a good random source, but probability rises with volume. Enforce a unique constraint in a database and retry on collision when uniqueness is critical. RFC 9562 also warns that UUIDs must not be treated as security capabilities.
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? No. Good generation makes collisions unlikely, but use a uniqueness constraint where duplicate IDs would cause harm.
Related Reading
A UUID lets distributed systems generate identifiers without coordinating each new value. Treat low collision probability as an engineering property, not an authorization or absolute uniqueness guarantee.