What a UUID v4 Is
A UUID (Universally Unique Identifier) is a 128-bit value written as 32 hex digits in a 8-4-4-4-12 pattern, like f47ac10b-58cc-4372-a567-0e02b2c3d479. Version 4 UUIDs are random: of the 128 bits, 122 are drawn from a cryptographically secure random source, while 6 are fixed by the spec — the 4 starting the third group marks the version, and the first character of the fourth group is always 8, 9, a, or b (the variant bits). That leaves 2¹²² ≈ 5.3 × 10³⁶ possible values, which is why nobody coordinates UUIDs and collisions still never happen in practice.
Bulk Generation, Properly Random
Set a count from 1 to 50 and click Generate; Copy All puts the batch on your clipboard one UUID per line, ready to paste into a SQL seed script, a fixtures file, or a spreadsheet column. Each UUID comes from the browser's native crypto.randomUUID() — a CSPRNG-backed API, not Math.random(). That distinction matters: Math.random() is predictable enough that "UUIDs" built from it can collide or be guessed; the Web Crypto source cannot.
Where UUIDs Beat Auto-Increment IDs
- Distributed systems: any client or service can mint an ID with zero coordination — no central counter, no round-trip to the database.
- Merging data: rows created offline or in separate databases can be combined without ID conflicts.
- Non-guessable references: sequential IDs leak information (
/invoice/1041invites probing/invoice/1042); random UUIDs don't enumerate. They're unguessable, though — not a substitute for real authorization checks. - Generated before insert: your code knows the ID before the row exists, which simplifies linking related records in one transaction.
Practical Notes and Pitfalls
- Storage: a UUID is 16 bytes as a native
UUID/binary column but 36 bytes as text — prefer the native type in Postgres or MySQL 8. - Index locality: random v4 values scatter across a B-tree index, which can slow huge insert-heavy tables. UUID v7 (time-ordered) addresses this; v4 remains the right default for general use.
- Case: the canonical form is lowercase, and comparisons should be case-insensitive.
- UUID = GUID: Microsoft's term for the same 128-bit format.
Generation runs entirely in your browser — no server ever sees or logs the identifiers, so they're safe to use directly in production data. Need random secrets rather than IDs? Use the password generator. Fingerprinting existing content instead? That's the hash generator.