UUID generator: create v4 and v7 UUIDs online, one or 1,000 at a time
Runs entirely in your browser. Nothing you type is sent to a server.
Short answer
A UUID is a 128-bit identifier written as 36 characters, like 3f2b8c1e-9a4d-4c7e-8b21-6d0e5f7a9c13. Use v4 (random) when you just need a unique ID, and v7 (Unix timestamp plus random bits) when the IDs are database keys that should sort by creation time; RFC 9562 recommends v7 over the older time-based v1 and v6. This UUID generator makes either version with your browser's cryptographic random number generator, up to 1,000 at once.
What is a UUID?
A UUID (universally unique identifier, also called a GUID in Microsoft land) is a 128-bit number you can create anywhere without asking a central server, with a vanishingly small chance of a clash. The current standard is RFC 9562, published in May 2024, which replaced RFC 4122 and added versions 6, 7 and 8.
The text form is 32 hex digits in five groups, 8-4-4-4-12. Two spots carry meaning: the first digit of the third group is the version, and the first digit of the fourth group holds the variant (8, 9, a or b for standard UUIDs).
Which UUID version should I use? v1 to v8 explained
| Version | Built from | Use it? |
|---|---|---|
| v1 | Gregorian timestamp + node ID (often a MAC address) | Legacy. RFC 9562 says use v7 instead where possible. |
| v2 | DCE Security | Rare; the RFC does not detail it. |
| v3 | MD5 hash of a namespace + name | Only for compatibility; prefer v5. |
| v4 | 122 random bits | Yes: the default for unique IDs. |
| v5 | SHA-1 hash of a namespace + name | Yes, when the same input must always give the same UUID. |
| v6 | v1 fields reordered so they sort by time | Only to upgrade v1 systems; prefer v7. |
| v7 | 48-bit Unix time in ms + random bits | Yes: for database keys and anything that should sort by creation time. |
| v8 | Vendor-specific layout | Custom formats only. |
There are also two special values: the Nil UUID (all zeros) and the Max UUID (all f), both defined in section 5.9 and 5.10 of the RFC.
How does this UUID generator work?
- v4: calls the browser's
crypto.randomUUID(), which returns a v4 UUID from a cryptographically secure random source. Where that is missing it fills 16 bytes withcrypto.getRandomValues()and sets the version and variant bits itself. - v7: writes the current Unix time in milliseconds into the first 48 bits, the version
7into the next 4, and random bits into the rest, as in section 5.7 of the RFC. If you generate many in the same millisecond, the 12 bits after the version act as a randomly seeded counter (the RFC's "Method 1"), so a bulk list still sorts in creation order. - Formatting options only change how the text looks: uppercase, no hyphens, or
{braces}as some Windows tools expect. The RFC says UUIDs are output in lowercase and should be read case-insensitively. - Nothing leaves your browser. There is no server call, so the IDs are never logged anywhere.
Get the AI tools worth your time
Era of Minds by Salman Ahmed: one short email with the AI tools and news that actually matter. Free.
You're in. Check your inbox.
Confirm your email and your 50 AI prompts are on their way.
Free. Unsubscribe anytime.
Worked example: reading a v7 UUID
RFC 9562 includes a test vector: 017F22E2-79B0-7CC3-98C4-DC0C0C07398F. Paste it into the decoder above.
- The first 12 hex digits,
017F22E279B0, are the timestamp: 1,645,557,742,000 milliseconds since 1970, which is February 22, 2022, 19:22:22 UTC. - The
7at the start of the third group is the version. - The
9at the start of the fourth group means the standard RFC variant. - The remaining digits are random.
That embedded time is why v7 keys insert in order into a B-tree index instead of landing at random pages, which is the main reason databases favour them. The flip side: anyone holding a v7 UUID can see roughly when it was created, so use v4 where that leaks something you care about.
Can two UUIDs ever be the same?
In theory yes, in practice no. A v4 UUID has 122 random bits. You would need to generate around 2.7 quintillion (2.7 × 1018) of them before the odds of a single duplicate reach 50%, by the standard birthday-bound estimate. A v7 UUID has 74 random-ish bits per millisecond, which is plenty for any one system. The RFC is clear that UUIDs should not be used as security tokens: being unique is not the same as being unguessable.
How do I generate a UUID in code?
- JavaScript (browsers and Node 19+):
crypto.randomUUID() - Python:
import uuid; uuid.uuid4() - PostgreSQL 13+:
gen_random_uuid() - Command line on macOS and most Linux:
uuidgen
Not sure which version to pick? Read UUID v4 vs v7. Building with an AI coding agent? See our guide to the best AI tools for coding. Need a time converter for a Discord event instead? Try the Discord time converter.
FAQ
What is a UUID generator?
A tool that creates universally unique identifiers: 128-bit IDs written as 36 characters, like 3f2b8c1e-9a4d-4c7e-8b21-6d0e5f7a9c13. This one makes random v4 UUIDs or time-ordered v7 UUIDs in your browser, up to 1,000 at a time.
What is the difference between UUID v4 and v7?
v4 is 122 random bits with no meaning. v7 starts with a 48-bit Unix timestamp in milliseconds followed by random bits, so v7 UUIDs sort by creation time, which suits database primary keys. RFC 9562 defines both.
Is UUID v4 random enough to be unique?
Yes. With 122 random bits you would need about 2.7 quintillion v4 UUIDs before the chance of one duplicate reaches 50%. Generate them with a cryptographic random source, as this tool does with crypto.randomUUID().
Are UUIDs case-sensitive?
No. RFC 9562 says UUIDs are written in lowercase but must be treated as case-insensitive on input, so 3F2B... and 3f2b... are the same UUID.
Is a GUID the same as a UUID?
Yes. GUID is Microsoft’s name for the same 128-bit identifier. Windows tools often show GUIDs in uppercase and wrapped in braces, which this generator can output.
Which RFC defines UUIDs?
RFC 9562, published in May 2024. It replaced RFC 4122 and added UUID versions 6, 7 and 8 plus the Max UUID.
Sources
Related
Get AI news decoded weekly.
Decoded is a free weekly email from Era of Minds. The AI stories that actually matter, in plain English. Five minutes, no hype.
You're in. Check your inbox.
Confirm your email and your 50 AI prompts are on their way.
Free. Unsubscribe anytime. Free gift: 50 AI prompts that actually work, sent the moment you join. More about Decoded