6 min read
2026-03-11
UUID (Universally Unique Identifier) is a standardized 128-bit identifier that guarantees uniqueness without central coordination. Format: `xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx`.
| Version | Basis | Use Case |
|---|---|---|
| v1 | Time + MAC | Server systems requiring time-based sorting |
| v3 | MD5 hash | Deterministic IDs from names |
| v4 | Random numbers | Most popular — suitable for most tasks |
| v5 | SHA-1 hash | Improved version of v3 |
UUID v4 is the optimal choice for most tasks:
Full randomness — the next ID is impossible to predict
No dependencies — no server or coordination needed
Global uniqueness — collision probability is negligible (1 in 5.3×10³⁶)
Use UUID instead of auto-increment IDs when:
Synchronizing data across multiple databases
You want to hide the number of records from users
Identifiers are needed before saving to the database
GET /api/users/550e8400-e29b-41d4-a716-446655440000
// Crypto API (modern approach) const id = crypto.randomUUID();
GUID (Globally Unique Identifier) is Microsoft's name for UUID. Technically they are the same thing, although Microsoft's GUID v4 may use slightly different encoding in some implementations.
Generate UUIDs instantly with the UUID Generator.
See also: Password Generator, Hash Generator, Base64 Encoder