What a UUID v4 is
A UUID is a 128-bit identifier written as 32 hex digits in five groups: 8-4-4-4-12. In version 4, 122 of those bits are random. The 13th digit is always 4 (the version) and the 17th is 8, 9, a or b (the variant), which is how you can tell a v4 UUID at a glance.
f47ac10b-58cc-4372-a567-0e02b2c3d479
^ ^
version variantHow unlikely is a collision?
With 122 random bits, you'd need to generate about 2.7 quintillion (2.7 × 10^18) UUIDs to have a 50% chance of a single duplicate. In practice, collisions only happen when the random number generator is broken. This tool uses the browser's cryptographic generator (crypto.randomUUID / crypto.getRandomValues), not Math.random.
UUID v4 vs v7 for database keys
Random v4 keys spread new rows across the whole index, which can slow inserts on large tables because the database keeps writing into different pages. UUID v7, standardised in RFC 9562 (2024), starts with a timestamp, so new keys sort roughly in creation order and index like an auto-increment. This tool generates v4, which is right for tokens, request ids and most keys; consider v7 if your database and library support it and insert speed matters.
Tips
- Store UUIDs in a native
uuidcolumn (PostgreSQL) or as 16 bytes, not as a 36-character string, to save space. - UUIDs are case-insensitive. Lowercase is the standard form, so compare them case-insensitively.
- A UUID is unique, not secret. Don't use one as the only protection on a private link if guessing it would matter; use a longer random token instead (Password Generator).