UUID Generator
Click generate for a fresh RFC 4122 UUID. Bulk-create up to 500 at once and copy them all.
What a UUID actually is, and where you use one
A UUID (Universally Unique Identifier) is a 128-bit value written as 32 hexadecimal digits in the pattern 8-4-4-4-12, for example f47ac10b-58cc-4372-a567-0e02b2c3d479. Its whole purpose is to let independent machines mint identifiers that will not collide without ever coordinating through a central authority. That property is why UUIDs show up as database primary keys, idempotency keys on payment APIs, correlation IDs threaded through microservice logs, message IDs on a queue, filenames for uploaded assets, and session identifiers. Microsoft calls the same 128-bit structure a GUID, so anything produced here works wherever a GUID is expected.
Using the generator
- Pick a version — v4 (random), v7 (time-ordered), or Nil (all zeros).
- Set How many (1–500) to create a single value or a whole batch at once.
- Toggle Uppercase, Hyphens, and Wrap in braces to match the exact format your database, language, or config file expects — the toggles reformat the current batch instantly without drawing new random values.
- Copy one row at a time, or use Copy all to grab the whole batch as newline-separated lines.
Anatomy: version and variant bits
Not every one of the 128 bits is random. Four bits encode the version (the first digit of the third group — a 4 for v4, a 7 for v7) and two bits encode the variant (which forces the first digit of the fourth group to be 8, 9, a, or b). That leaves 122 free bits in a v4 UUID. Those fixed bits are why a valid v4 always looks like xxxxxxxx-xxxx-4xxx-{8,9,a,b}xxx-xxxxxxxxxxxx, and why you can glance at a string and tell which version produced it.
Worked examples
9b2e4f6a-1c3d-4e5f-a7b8-c9d0e1f2a3b4, the 4 opening the third group marks it version 4, and the a opening the fourth group is the variant marker. Everything else is randomness from your browser's cryptographic generator — 122 bits, about 5.3×1036 possibilities.01890a5d-ac96-7..., those first 12 hex digits (01890a5dac96) equal 1,686,835,215,000 ms — about 2023-06-15 in UTC. That embedded time is exactly why v7 values sort in creation order.Choosing a version
| Version | Random bits | Sortable? | Best for |
|---|---|---|---|
| v4 — random | 122 | No | General IDs, anything where opacity matters |
| v7 — time-ordered | 74 | Yes (by time) | Database keys, B-tree indexes, event streams |
| Nil | 0 | — | A placeholder / "no ID yet" sentinel |
Common mistakes and practical tips
- Using random v4 as a clustered primary key. Random keys scatter inserts across a B-tree index and fragment it. v7's leading timestamp keeps inserts sequential and pages compact — prefer it for that job.
- Treating a UUID as a secret. A v4 has strong entropy, but a v7 exposes its creation time, and any UUID printed in a URL or log is visible. Use a dedicated token for authentication, not an identifier.
- Case and brace mismatches. UUIDs are case-insensitive by spec, but the string comparisons in your code are not. Some systems (older Windows/COM, SQL Server) expect braces
{...}; most databases and JSON do not. Match the exact format with the toggles rather than hand-editing. - Relying on Math.random. This tool never does — every value comes from the browser's cryptographically secure generator, so a batch is safe for real keys, not just throwaway demos.
Limits
A UUID guarantees uniqueness, not meaning — it carries no information about the row it labels beyond, for v7, a timestamp. It is also far longer than a 32- or 64-bit integer, so it costs more storage and index space; that trade is usually worth it for the freedom to generate keys anywhere without coordination.
Sources & further reading
- RFC 9562 (IETF) — the current UUID specification, including versions 4 and 7
- MDN Web Docs — crypto.randomUUID(), the browser API for secure v4 generation
- ISO/IEC 9834-8 — the international standard aligned with UUID structure and variants
- NIST Random Bit Generation project — guidance on cryptographically secure randomness
Frequently asked questions
What is a UUID, and is a GUID the same thing?
A UUID (Universally Unique Identifier) is a 128-bit value defined by RFC 4122 (updated by RFC 9562), written as 32 hexadecimal digits in five hyphen-separated groups like 550e8400-e29b-41d4-a716-446655440000. GUID (Globally Unique Identifier) is Microsoft's name for exactly the same thing, so this UUID generator doubles as a GUID generator. Because a random UUID draws from 2^122 possibilities, anyone can create one independently on any machine — no central registry — and still trust it will not collide.
UUID v4 vs UUID v7 — which one should I use?
A UUID v4 generator produces 122 bits of pure randomness — perfect as a general random UUID whenever you just need uniqueness. A UUID v7 generator produces time-ordered values: the first 48 bits are a Unix millisecond timestamp, so v7 UUIDs sort chronologically. That makes v7 ideal for database primary keys and B-tree indexes, where sequential inserts stay compact and fast instead of scattering across the index the way random v4 keys do. Choose v4 for opacity and no time leakage; choose v7 when insert locality and sortability matter.
Are these UUIDs really unique and random?
Yes. Every random value comes from crypto.getRandomValues (using crypto.randomUUID where the browser offers it) — the cryptographically secure generator built into your browser, never the predictable Math.random. With 122 random bits, the odds of two v4 UUIDs colliding are astronomically small: you would have to generate billions per second for roughly a century before a collision became likely. If a browser is too old to provide a secure generator, this tool disables itself instead of silently falling back to something insecure.
Are the generated UUIDs sent anywhere?
No. This uuid generator runs 100% in your browser — every UUID v4, UUID v7 and nil value is created locally in JavaScript, and nothing is ever uploaded, logged, or shared. That makes it safe for API keys, database rows, secrets, and test fixtures. The values are one-shot: reload the page and they are gone, because nothing is stored.
How do I generate UUIDs in bulk and copy them all at once?
Set the count to any number from 1 to 500 and click Generate to create a whole batch. Each row has its own copy button, or use "Copy all" to put the entire list on your clipboard as newline-separated lines — perfect for seeding a database, filling a test dataset, or pasting into a spreadsheet. The format toggles (Uppercase, Hyphens, and Wrap in braces) reformat the current batch instantly without regenerating, so you can match whatever your database or code expects.