UUID Generator v4
Generate random version 4 UUIDs instantly.
About UUID Generator v4
A version 4 UUID is 128 bits, of which 122 are drawn from a secure random source and 6 are fixed markers that record the version and variant. It is written as 32 hexadecimal digits in five hyphenated groups — 8-4-4-4-12, 36 characters in total. Set a quantity, press Generate, and the list below is yours to copy.
Unique without a coordinator
The appeal of a random identifier is that nothing has to agree on it. An auto-incrementing integer needs a single authority to hand out the next value, which becomes awkward the moment you have several database shards, an offline-capable mobile client, or a queue consumer that must create a record before the write lands. A v4 UUID can be minted anywhere — in a test, in the browser, in a Lambda — and stays valid when the rows are merged.
What you give up
Randomness costs you ordering and compactness. Rows keyed by v4 cannot be sorted by creation time without a separate timestamp column, and because consecutive inserts scatter across the index, write throughput on a large clustered table degrades in a way sequential keys avoid. The text form is also 36 characters against 4 or 8 bytes for an integer, which shows up in every foreign key, every index and every log line. Version 7, which puts a millisecond timestamp in the high bits, exists precisely to recover the ordering.
Generated here, kept here
Generation is a call to the browser's own crypto API — there is no server involved, nothing is recorded, and the same identifier is never handed to anyone else. That also means the page keeps working with the network disconnected, which is convenient when you just need a hundred keys for a fixture file on a plane.
Reasonable and unreasonable uses
Good fits: primary keys in distributed stores, idempotency keys on payment and webhook endpoints, correlation IDs threaded through logs and traces, filenames for uploaded assets, and seed data. Poor fits: anything a person must read aloud or retype, anything needing to sort chronologically, and any long-lived credential — an API key should be revocable and scoped, which a bare identifier is not. If you need a fingerprint of some content rather than a fresh random value, the Hash Generator is the tool for that.
One To A Hundred Per Run
Set the quantity and every press of Generate replaces the list with a fresh batch, numbered so you can keep your place while filling out a fixture or a seed script.
Canonical RFC 9562 Form
Lowercase, hyphenated, unbraced, with the version 4 marker in the third group and the variant bits in the fourth — the exact shape a uuid column or a Java UUID.fromString expects.
Copy Ready For A Column
The Copy button puts the whole batch on the clipboard, one identifier per line, so it pastes cleanly into a spreadsheet, a SQL insert or a test file.
Frequently Asked Questions
How do I tell a v4 UUID from the other versions by eye?
Look at two positions. The first character of the third group is the version, so a v4 always reads xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx. The first character of the fourth group is the variant and will be 8, 9, a or b. Those six fixed bits are why a v4 carries 122 random bits rather than 128. If the third group starts with a 1 or a 7 you are looking at a time-ordered identifier from a different generator.
Where does the randomness come from?
From the operating system, by way of the browser. The generator calls crypto.randomUUID where it exists and falls back to crypto.getRandomValues, both of which are cryptographically secure sources — Math.random is never involved. That matters if an identifier ever doubles as an unguessable handle, such as a share link or a password-reset token, because a predictable generator would make those enumerable.
How likely is a collision, really?
With 122 random bits you would need to generate on the order of 2.7 quintillion UUIDs before reaching a fifty-fifty chance of a single duplicate. At a million per second that is longer than the age of the universe. In practice the duplicates people actually hit come from a broken generator seeded identically across processes, or from a value being copied rather than generated, not from exhausting the space.
Should I use a v4 UUID as a primary key?
In a distributed system where clients mint their own IDs, yes — that independence is the whole point. Be aware of the storage cost though. Random keys arrive in no particular order, so on a clustered index such as InnoDB's or SQL Server's every insert lands at a random page and the index fragments. Storing the value as 16 raw bytes rather than a 36-character string, or switching to a time-ordered scheme like UUIDv7 or ULID, both help.
Can I get uppercase, braces, or a version other than 4?
Not from this page. Output is always lowercase, hyphenated and unbraced, which is the canonical form from RFC 9562 and what PostgreSQL, MySQL and most libraries expect. Windows and .NET tooling often shows the same value wrapped in braces and uppercased; those are display conventions for identical bytes, so converting is a case change. Versions 1, 5 and 7 need a MAC address, a namespace or a timestamp respectively and are not generated here.
Do the identifiers regenerate if I change the quantity?
Not on their own. Editing the quantity field only sets how many the next run produces — press Generate to actually create them. The count is clamped between 1 and 100, and each run replaces the whole list, so copy what you need before generating again. Copy places every identifier on its own line, ready to paste into a seed file or a spreadsheet column.