v4 or v7?
- UUID v4 is 122 random bits. It reveals nothing and is the default choice for most IDs.
- UUID v7 (RFC 9562, 2024) starts with a 48-bit millisecond timestamp followed by random bits. New IDs sort after old ones, which keeps database B-tree indexes compact and inserts fast. It does reveal the creation time.
Will I ever get a duplicate?
With v4 you would need to generate about 2.7 quintillion UUIDs to have a 50% chance of a single collision. Randomness here comes from crypto.getRandomValues, the browser’s cryptographically secure generator.
Validate a UUID
Paste any UUID in the inspector to see its version and variant — and for v7 or v1, the timestamp inside it.