What is a UUID and how do I generate one?
A UUID (universally unique identifier) is a 128-bit value written as 32 hex digits in five groups, like 5b30857f-0bfa-48b5-ac0b-5c64e28078d1. Anyone can create one at any time, on any machine, with no coordination, and the chance of two matching is negligible. Press Generate above: you get a v4 straight away, and a switch to v7, Nil or Max is one click.
The standard is RFC 9562, published in May 2024. It replaced RFC 4122 and added versions 6, 7 and 8 (we checked the RFC text in December 2026).
How to use this UUID generator
- Pick a version. v4 is fully random. v7 puts the current time first so IDs sort in creation order.
- Type how many you need, from 1 to 1000, and press Generate.
- Set the format: uppercase, no hyphens, braces, quotes and a trailing comma. The list changes at once, without making new IDs.
- Press Copy all, or Download .txt for a file with one UUID per line.
IN (...) clause or an array. The last line has no trailing comma.What is the difference between UUID v4, v7 and GUID?
A GUID is not a different thing. It is Microsoft's name for a UUID, and RFC 9562 itself says "also known as GUIDs". The versions differ in what the bits mean.
| Type | Layout | Sortable | Privacy | Good for |
|---|---|---|---|---|
| v4 | 122 random bits | No | Random, nothing to leak | Public IDs, tokens-like IDs, small tables |
| v7 | 48-bit Unix ms time + 74 random bits | Yes, by creation time | Reveals when it was made | Database primary keys, event and log IDs |
| GUID | Same 128 bits, Microsoft name | Depends on version | Same as the version used | .NET, SQL Server, Windows APIs |
| Nil | All 128 bits zero | n/a | n/a | A placeholder meaning "no UUID" |
| Max | All 128 bits one | n/a | n/a | A sentinel upper bound |
Version 4 sets 6 fixed bits (the version 0100 and the variant 10) and fills the other 122 with random data. Version 7 sets the same 6 bits, stores the Unix time in milliseconds in the first 48 bits (big-endian), and fills the remaining 74 bits with random data.
How likely is a UUID collision?
The birthday approximation says that with n random IDs drawn from N possible values, the chance of any repeat is about n2 / (2N). For v4, N = 2122 ≈ 5.3 × 1036.
- One billion UUIDs: 1018 / (2 × 5.3 × 1036) ≈ 9 × 10-20.
- A 50% chance: needs about 1.18 × √N ≈ 2.7 × 1018 IDs. At a billion per second that is about 86 years of nonstop generation.
- v7 inside one millisecond: only the 74 random bits protect you, so N = 274 ≈ 1.9 × 1022. IDs from different milliseconds cannot collide because their timestamps differ. This generator also counts upward inside a millisecond, so one browser tab never repeats a v7. Two separate machines generating in the same millisecond share only the 74 random bits: a thousand IDs from independent sources in one millisecond collide with probability about 3 × 10-17.
These figures assume a good random source. That is why the generator uses the browser's cryptographic one.
Should I use UUID v4 or v7 for a database?
Use v7 for primary keys on large tables. RFC 9562 notes that random UUIDs such as v4 have poor index locality: new rows land at random places in a B-tree, which it says can hurt performance dramatically, and it reports that time-ordered keys can be an order of magnitude or more faster. v7 keeps new keys near each other, so inserts append and the hot part of the index stays small.
Use v4 when the ID is exposed to users and the creation time must stay private, or on small tables where insert order does not matter. PostgreSQL 18 and later ship both uuidv4() and uuidv7() (version 17 has neither; checked December 2026). PostgreSQL stores them in a native 16-byte uuid type. Store UUIDs in binary or a native type, not as 36-character strings.
Is the randomness secure?
Every random bit comes from crypto.getRandomValues, the Web Crypto API your browser uses for cryptographic keys. This page never calls Math.random, which is predictable and unsuitable for identifiers. Nothing is sent to a server, so the UUIDs exist only on your device until you copy them.
Even so, a UUID is an identifier, not a secret. RFC 9562 says UUIDs must not be used as security capabilities, so do not use one as a password, API key or reset token.
How do I check whether a UUID is valid and what version it is?
Paste it into the decoder. A valid UUID is 32 hex digits, either in the 8-4-4-4-12 hyphen pattern or as 32 digits with no hyphens. The tool then reads two fields:
- Version: the first digit of the third group.
4is random,7is Unix time plus random,1is the older Gregorian time version. - Variant: the first digit of the fourth group.
8,9,aorbmeans the layout from RFC 9562.canddare reserved for Microsoft compatibility.
For v7 (and v1) the decoder also turns the embedded timestamp into a date in UTC and in your own time zone. A UUID that is well formed but has a version digit outside 1 to 8 is reported as having an undefined version, because RFC 9562 does not assign it.
Edge cases and limits
- Nil and Max. The Nil UUID is all zeros and the Max UUID is all ones. They are special values, not random IDs, so the decoder labels them separately.
- Batches of v7. IDs made in the same millisecond share a timestamp, so this tool starts from a random 74-bit value and adds 1 for each next ID (the monotonic method in RFC 9562 section 6.2). A batch, and every batch made in the same tab, is strictly increasing. If the clock stalls or steps back, the last timestamp is reused so order never breaks. Order across different machines is only by timestamp.
- Wrong clock. A v7 embeds your device's clock. If your clock is off, so is the embedded date.
- Case. Hex digits may be upper or lower case. RFC 9562 allows both when reading a UUID. Lowercase is the default here because it is the common convention.
- Big batches. The page caps one batch at 1000. Larger numbers are clamped and an empty field counts as 1.
Frequently asked questions
What is a UUID generator?
A UUID generator creates 128-bit identifiers that are unique in practice without any central registry. This one makes version 4 (random) and version 7 (time-ordered) UUIDs as defined in RFC 9562, entirely in your browser.
Are UUIDs really unique?
Not by guarantee, but by probability so low it can be ignored. A v4 UUID has 122 random bits, so you would need about 2.7 quintillion of them for a 50% chance that any two match. Generating a billion per second, that takes roughly 86 years.
What is the difference between UUID v4 and v7?
v4 is 122 bits of randomness, so values arrive in no order. v7 starts with a 48-bit Unix millisecond timestamp followed by 74 random bits, so newer IDs sort after older ones. Use v7 for database primary keys, v4 when the ID must reveal nothing.
Is a GUID the same as a UUID?
Yes. GUID is Microsoft's name for the same 128-bit value, usually written in uppercase and often in braces. Turn on UPPERCASE and {Braces} above to get the .NET and Windows style.
Can I use a UUID as a password or secret token?
No. RFC 9562 says UUIDs must not be used as security capabilities, meaning identifiers whose mere possession grants access. A v4 is unpredictable, but a v7 exposes its creation time, and neither is designed as a secret. Use a dedicated random token for that.
Is this UUID generator secure?
The random bits come from the Web Crypto API (crypto.getRandomValues), the browser's cryptographically secure generator. The page never uses Math.random, and nothing you generate or paste is sent anywhere.
How do I find out if a UUID is v4 or v7?
Look at the first digit of the third group. In 0190a2b3-c4d5-7e6f-8a9b-0c1d2e3f4a5b it is 7, so the version is 7. Paste any UUID into the decoder above and it reads this for you, plus the embedded date for v7.
Is it safe to generate UUIDs in bulk in the browser?
Yes. 1000 UUIDs take a few milliseconds. For more, press Generate again and append the results, or generate them in your own code with the same method.