v4 or v7?
- UUID v4 is 122 random bits, the most common choice for IDs, API keys and file names.
- UUID v7 starts with a millisecond timestamp, so new IDs sort in creation order. That makes database indexes much faster than random v4 IDs. It is defined in RFC 9562 (2024).
The chance of two random v4 UUIDs ever colliding is negligible: you would need to create about 2.7 quintillion of them for a 50% chance of a single duplicate.
Frequently asked questions
Is a GUID the same as a UUID?
Yes. GUID is Microsoft's name for the same 128-bit identifier, often written in upper case with braces, like {3F2504E0-4F89-11D3-9A0C-0305E82C3301}.