tools / uuid
uuid/
Generate UUID v4 and time-ordered v7 in bulk, or read the version and time inside a UUID. Made locally with your browser's secure random numbers; nothing is uploaded.
UUID v4
| Nil UUID | 00000000-0000-0000-0000-000000000000 |
|---|---|
| Max UUID | ffffffff-ffff-ffff-ffff-ffffffffffff |
What is a UUID
A UUID is a 128-bit identifier defined by RFC 9562, written as 32 hexadecimal digits with 4 dashes. Version 4 has 122 random bits; version 7 starts with a 48-bit Unix millisecond timestamp, so it sorts by creation time. This page generates both in bulk and decodes existing UUIDs.
How it works: version, variant and the v7 counter
- Of the 128 bits, bits 48–51 hold the version and bits 64–65 hold the variant 10. So in the standard text form the 13th hex digit is the version, and the 17th is 8, 9, a or b.
- All other 122 bits of a v4 are random. This page uses crypto.randomUUID when available; otherwise it takes 16 bytes from crypto.getRandomValues and overwrites those 6 bits.
- A v7 starts with a big-endian 48-bit Unix millisecond timestamp, followed by 12 bits of rand_a and 62 bits of rand_b. Following method 1 in RFC 9562 section 6.2, this page uses rand_a as a counter: each new millisecond it starts from an 11-bit random number with the top bit 0, adds 1 for every UUID in the same millisecond, and moves the timestamp ahead by 1 millisecond if it passes 4095. rand_b is random for every UUID, so the v7 values from this page are strictly increasing.
- When decoding, v7 is read straight from the first 48 bits; v1 and v6 store the time as 100-nanosecond intervals since 1582-10-15, which this page converts to Unix milliseconds. Other versions contain no time.
The 122 random bits of a v4 allow about 5.3 × 10^36 values; you would need about 2.7 × 10^18 of them before the chance of a single duplicate reaches 50%.
Example
The first example decodes the v7 test vector from RFC 9562 appendix A.6: its first 12 hex digits, 017F22E279B0, are the millisecond timestamp 1645557742000. The second is the v4 test vector from appendix A.3; a v4 holds no time, so both time fields are null.
- Input
- 017F22E2-79B0-7CC3-98C4-DC0C0C07398F
- Output
canonical 017f22e2-79b0-7cc3-98c4-dc0c0c07398f version 7 variant rfc9562 timestamp_ms 1645557742000 time_utc 2022-02-22T19:22:22.000Z
- Input
- 919108f7-52d1-4320-9bac-f847db4148a8
- Output
canonical 919108f7-52d1-4320-9bac-f847db4148a8 version 4 variant rfc9562 timestamp_ms null time_utc null
Sources
FAQ
UUID v4 or v7: which should I use
Use v4 when you just need a random unique ID with no time information. Use v7 for database primary keys or anything you want sorted by creation time: its first 48 bits are a millisecond timestamp, so sorting by text or bytes sorts by creation time. Both are 128 bits with the same text form and fit the same UUID column type.
Does a UUID v7 reveal when it was created
Yes. The first 12 hex digits are the Unix millisecond timestamp at creation, so anyone holding a v7 can read the exact millisecond it was made; the decoder on this page shows it. If the time must stay private, use v4. RFC 9562 also recommends v4 for anything security related.
Can generated UUIDs repeat
In theory yes, in practice you can ignore it. A v4 has 122 random bits; it takes about 2.7 × 10^18 of them before the chance of one duplicate reaches 50%. The v7 values from one page are strictly increasing, so they never repeat; v7 values made on different devices in the same millisecond are told apart by the 11 random bits of the counter start and the 62 random bits of rand_b.
Are UUID and GUID the same thing
They are the same 128-bit identifier; RFC 9562 says right at the start that UUIDs are also known as GUIDs. A Microsoft document cited by RFC 9562 describes a GUID text form in curly braces; choose "Braces" on this page to get that form. The only difference is in binary storage: Microsoft COM saves GUIDs little-endian, while RFC 9562 specifies big-endian. As text they are identical.
Are v7 UUIDs made in the same millisecond in the right order
Yes. This page uses the 12 bits of rand_a as a counter: each new millisecond starts from an 11-bit random number, every UUID in the same millisecond adds 1, and past 4095 the timestamp moves ahead by 1 millisecond and the counter starts again. If the system clock goes backwards, it keeps the previous timestamp and keeps counting. So the v7 values from one page are strictly increasing in creation order, and sorting them as text gives the same order. There is no such guarantee across devices or browser tabs.
Is it still the same UUID in uppercase, without dashes or in braces
Yes, only the form changes. RFC 9562 allows uppercase or lowercase hex letters; the text form is 8-4-4-4-12 with dashes, and the URN form adds urn:uuid: in front. Pick one form before storing UUIDs in a database, otherwise a text comparison treats them as two values. The decoder on this page accepts all of these forms and shows the standard lowercase form with dashes.
Can I use a UUID as a password or access token
Don't. RFC 9562 section 8 says implementations should not assume UUIDs are hard to guess and must not use them as credentials whose mere possession grants access. For passwords or tokens, use values generated for that purpose, such as the random passwords on this site's password generator page.
Are the UUIDs I generate or decode uploaded or logged
No. Random numbers come from your browser's crypto.getRandomValues (crypto.randomUUID first for v4). Generating and decoding happen on your device with no network requests and nothing saved; reloading the page clears everything. You can make up to 1000 at a time, and the .txt download is also created locally.