$ uuid --gen
uuid generator.
Generate UUIDs v1, v4, or v7 in bulk. 100% client-side.
settings
version
quantity
results
0 UUIDs
Click "Generate" to create UUIDs
UUID v1 uses timestamp + MAC address (traceable). v4 is random (most common). v7 is time-ordered random, ideal for database primary keys.
Use v4 for most applications. Use v7 for database primary keys (better index performance due to sequential ordering). Use v1 only if you need timestamp tracking.
v4 has 2^122 possible values — the chance of collision is astronomically low (1 in 5.3 quintillion). For practical purposes, they are unique.
UUID Versions Compared
| Version | Method | Random? | Best For |
|---|---|---|---|
| v1 | Timestamp + MAC address | Time-based | Legacy systems (leaks MAC!) |
| v3 | MD5 namespace hash | Deterministic | Same input → same UUID |
| v4 | Random | Yes | General purpose, most common |
| v5 | SHA-1 namespace hash | Deterministic | Same input → same UUID (better than v3) |
| v7 | Timestamp + random | Time-ordered | Database primary keys (new!) |
Format Breakdown (v4)
xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
| | | |
| | | └─ version (4)
| | └─ variant (8, 9, a, or b)
| └─ random
└─ random
Database tip: UUID v7 is time-ordered, making it ideal for database primary keys — it avoids the random page splits that v4 causes in B-tree indexes.
learn more in our detailed guide.
→ read the guide