UUID Generator
Make version 4 or version 7 UUIDs, one or a thousand. They are made in your browser.
https://flxcode.com/uuid-generator/
Made in your browser with the Web Crypto random generator. Nothing is sent to us or stored.
No ads. No account. Nothing you type or record is uploaded. We count page events with a daily code. Check it.
Problem or idea? Email us
Quick start
- Choose v7 for ids you will sort or index, or v4 for plain random ids.
- Set how many, from 1 to 1,000, and press Generate.
- Tick Uppercase, Braces or untick Hyphens if your system wants another form. The list changes at once.
- Copy all, or download a .txt file with one id per line.
Numbers this uses
- Version 4: 122 random bits. The other 6 bits are the version (0100) and the variant (10), as set by RFC 9562.
- Version 7: 48 bits of Unix time in milliseconds, 4 version bits, a 12-bit counter, 2 variant bits and 62 random bits.
- Counter: starts at a random value below 2048 in each new millisecond and goes up by one. 4,096 values fit in one millisecond before the timestamp moves ahead.
- Random source:
crypto.getRandomValues, andcrypto.randomUUIDfor version 4 where the browser has it. - Largest batch: 1,000 ids per press. Our limit, to keep the page quick.
Worked examples
These come from the same functions as the tool, with fixed inputs so you can check them.
A version 7 id from the RFC test values
RFC 9562 gives a test case: time 0x017F22E279B0 ms, rand_a 0xCC3 and rand_b 0x18C4DC0C0C07398F. The tool builds it as:
017f22e2-79b0-7cc3-98c4-dc0c0c07398f
017f22e2-79b0is the time: 0x017F22E279B0 = 1,645,557,742,000 ms = 2022-02-22T19:22:22.000Z.7cc3is the version digit 7 followed by the 12-bit counter 0xCC3.98c4holds the variant and the first random bits: the top two bits are the variant 10, and the other 14 bits are the random bits 0x18C4 gives.
A version 4 id from fixed bytes
The bytes 1b 4e 28 ba 2f a1 11 d2 88 3f b9 a7 61 bd e3 fb become:
1b4e28ba-2fa1-41d2-883f-b9a761bde3fb
The digit after the second hyphen is forced to 4 and the digit after the third is forced into 8, 9, a or b. Every other digit is random.
Three ids made in the same millisecond
With the clock stopped and the random bytes zero, only the counter changes, and the ids still sort in order:
| Id | Counter |
|---|---|
| 017f22e2-79b0-7000-8000-000000000000 | 000 |
| 017f22e2-79b0-7001-8000-000000000000 | 001 |
| 017f22e2-79b0-7002-8000-000000000000 | 002 |
The same id in each format
| Option | Result |
|---|---|
| Default | 017f22e2-79b0-7cc3-98c4-dc0c0c07398f |
| Uppercase | 017F22E2-79B0-7CC3-98C4-DC0C0C07398F |
| Braces | {017f22e2-79b0-7cc3-98c4-dc0c0c07398f} |
| No hyphens | 017f22e279b07cc398c4dc0c0c07398f |
| Uppercase, braces | {017F22E2-79B0-7CC3-98C4-DC0C0C07398F} |
Hex digits are not case sensitive, so upper and lower case are the same id. A UUID without hyphens is 32 characters.
Version 4 or version 7
| Version 4 | Version 7 | |
|---|---|---|
| Random bits | 122 | 74 (12 counter, 62 random) |
| Sorts by creation time | No | Yes |
| Shows when it was made | No | Yes, to the millisecond |
Version 7 has fewer random bits, but two ids made in different milliseconds can never match, and two made in the same millisecond must also match in the counter and the 62 random bits.
In code
- JavaScript:
crypto.randomUUID()gives a version 4 id in browsers and in Node 14.17 and later. - PostgreSQL:
gen_random_uuid()is version 4. PostgreSQL 18 addeduuidv7(). - Python:
uuid.uuid4(). Version 7 is in the standard library from Python 3.14.
Limits
- Not for secrets. A UUID is an identifier. Do not use one as a password or an access token when a longer random value from a proper library is available.
- Version 7 ids carry your computer's clock. A wrong clock gives wrong times inside the ids.
- No versions 1, 3, 5 or 6, and no nil or max UUID. Those need a MAC address, a name or a namespace this page does not ask for.
Nothing you make here is uploaded. We count events without cookies, such as the version used, never an id (details).
FAQ
What is a UUID?
A UUID is a 128-bit identifier written as 32 hex digits in five groups, like 123e4567-e89b-12d3-a456-426614174000. Programs make them without asking a central server, and the chance of two being the same is tiny. Microsoft calls the same thing a GUID.
What is the difference between v4 and v7?
Version 4 is random: 122 of the 128 bits are random, so the ids have no order. Version 7 puts the time in milliseconds in the first 48 bits and fills the rest with a counter and random bits, so ids made later sort after ids made earlier. Both are defined in RFC 9562.
Which one should I use for a database key?
Version 7 if the key is indexed. New rows then land at the end of the index instead of all over it, which usually means fewer page splits and a smaller index. Version 4 is the better pick when the id must not reveal when it was made, for example in a public link.
Can two UUIDs be the same?
Only by luck, and the luck is very bad. For version 4, the chance that any two of one billion ids match is about 9.4 × 10^-20. For a trillion ids it is about 9.4 × 10^-14. These come from the birthday formula n(n-1)/2 ÷ 2^122.
Does a v7 UUID show when it was made?
Yes. The first 12 hex digits are the Unix time in milliseconds. 017f22e2-79b0 is 1,645,557,742,000 ms, which is 2022-02-22T19:22:22.000Z. If that matters for privacy, use version 4.
How are the random bits made?
With crypto.getRandomValues, the browser's security-grade generator. Version 4 uses crypto.randomUUID when the browser has it. Math.random is never used. The version 7 code is written by hand from RFC 9562, with the version digit 7 and the variant bits 10 set as the standard says.
Do ids from one batch sort in order?
For version 7, yes. Ids made in the same millisecond use a 12-bit counter that goes up by one each time, as RFC 9562 allows in section 6.2. If the counter would pass 4095 the timestamp moves ahead by one millisecond, and if your clock goes back the last timestamp is kept. Version 4 ids have no order.
How many can I make at once?
Up to 1,000. That keeps the page fast and the text box readable. For more, press Generate again and paste the lists together. Download .txt saves what is in the box, one id per line.
More from FLXCode
Password GeneratorNew
Make a random password or passphrase in your browser. See the entropy and its formula. Nothing is sent.
JSON FormatterNew
Format, minify, sort and check JSON in your browser. Big numbers stay exact and errors show line and column.
Regex TesterNew
Test JavaScript regular expressions with live matches, groups, flags and a replace preview. Runs in your browser.
Case ConverterNew
Change text to sentence case, Title Case, UPPERCASE, camelCase, snake_case and more. Copy any result.