UUID Generator
Bulk v4 and v7 UUIDs from the Web Crypto API. Uppercase / no-dash options.
Runs entirely in your browser — nothing you paste is uploaded.
About UUID Generator
A UUID is 128 bits formatted as 32 hex digits in five hyphenated groups. Version 4 fills 122 of those bits with randomness, which is enough that collisions are not a practical concern — you would need to generate about a billion a second for 85 years to reach a 50% chance of one.
Version 7 is the newer and often better choice. It replaces the first 48 bits with a Unix millisecond timestamp, keeps the rest random, and is therefore lexicographically sortable in generation order. That matters for database primary keys: a v4 UUID inserted into a B-tree index lands at a random position and fragments the index, while a v7 appends at the end like an auto-increment integer, but without the coordination a sequence needs.
Both are generated here with `crypto.getRandomValues`, the platform's cryptographically secure random source — never `Math.random`, which is fast, predictable, and completely unsuitable for anything that needs to be unguessable. The version and variant bits are set per RFC 9562, so the output validates as a proper UUID rather than merely looking like one.
Options cover the formats different systems want: uppercase for anything Microsoft-flavoured, hyphens stripped for compact storage, and bulk generation up to 500 at a time for seeding fixtures. The nil UUID — all zeros — is there too, since it's the conventional 'no value' sentinel and nobody remembers how many zeros it has.
Frequently asked
›Should I use UUID v4 or v7 for a database primary key?
v7, in almost every case. Its leading timestamp makes inserts sequential, which keeps a B-tree index compact instead of writing to random pages. v4 is the right choice when the identifier is exposed publicly and you don't want it to leak creation time.
›Do UUIDs ever collide?
Not at any scale you will reach. With 122 random bits, the probability of a duplicate after a billion UUIDs is around one in 10^22. The realistic collision risk comes from a broken random source, not from the maths — which is why the source matters more than the version.
›Is a UUID safe to use as a security token?
A v4 from a cryptographic source has 122 bits of entropy and is unguessable, so yes. A v7 leaks the creation timestamp in its first 48 bits, and a v1 leaks the MAC address of the generating machine. For a password-reset link, use v4 or random bytes.
›What is the difference between a UUID and a GUID?
Nothing, in practice. GUID is Microsoft's name for the same 128-bit identifier. The only real difference is presentation convention: Microsoft tooling tends to uppercase them and sometimes wraps them in braces.
›How do I tell which version a UUID is?
The first character of the third group. `xxxxxxxx-xxxx-4xxx-...` is version 4, `...-7xxx-...` is version 7. The first character of the fourth group encodes the variant and should be 8, 9, a or b for any RFC-conformant UUID.