UUID
generator.
Make version 4 or version 7 UUIDs, or decode one to see its version and creation time.
- Version
- 4
- Random bits each
- 122
- Repeat chance here
- None
A version 4 ID holds nothing but its version, its variant and random bits, so it says nothing about when or where it was made. Its digits come straight from your browser’s cryptographic generator.
What each digit holds
RFC 9562 layoutf3ea87a0-c949-4300-abc4-0687fd2726fb, version 4. Digits 1 to 12: random (48 bits); Digits 13 to 13: version (4 bits); Digits 14 to 16: random (12 bits); Digits 17 to 17: variant (2 bits); Digits 17 to 32: random (62 bits).
Fields of this UUID
| Field | Bits | Value |
|---|---|---|
| Random | 48 | f3ea87a0c949 |
| Version | 4 | 0100 (binary) |
| Random | 12 | 300 |
| Variant | 2 | 10 (binary) |
| Random | 62 | 2bc40687fd2726fb |
This batch, checked line by line
- Valid UUIDs
- 1 of 1
- Repeated lines
- 0
Every UUID in this batch
| UUID | Made (UTC) | ||
|---|---|---|---|
| 1 | f3ea87a0-c949-4300-abc4-0687fd2726fbRandom | 4 | Random |
Could two ever match?
Chance of at least one repeat
| IDs | v4 repeat | v7, one ms |
|---|---|---|
| 1,000 | 9.4 × 10⁻³² | at most 1.1 × 10⁻¹³ |
| 1 million | 9.4 × 10⁻²⁶ | at most 1.1 × 10⁻⁷ |
| 1 billion | 9.4 × 10⁻²⁰ | at most 10.3% |
| 1 trillion | 9.4 × 10⁻¹⁴ | at most 100% |
A 50% chance of one repeat takes about 2.71 × 10¹⁸ version 4 IDs, or 2,528,468,770 version 7 IDs from this tool made in the very same millisecond. IDs from one v7 batch never match each other, because the counter differs.
Keyboard shortcuts
- G makes a new batch with the same settings.
- C copies every UUID shown, one per line.
- Both work when no box or button has focus; click an empty part of the page first if you were typing.
How it's worked out
A UUID is 128 bits, written as 32 hex digits in groups of 8, 4, 4, 4 and 12. RFC 9562, published in 2024, sets out the versions. Two places are fixed in every standard UUID: the 13th digit is the version, and the first bits of the 17th digit are the variant, 10 in binary, which makes that digit 8, 9, a or b.
A version 4 UUID fills the other 122 bits with random data. This tool takes them from crypto.getRandomValues, the same cryptographic source as crypto.randomUUID in browsers.
A version 7 UUID starts with the Unix time in milliseconds, in 48 bits, so IDs made later sort later. The next 12 bits here hold a counter. It starts at a random value below 2,048 and goes up by one for each ID in a batch, which is one of the methods RFC 9562 gives to keep IDs in order within the same millisecond. The last 62 bits are random.
The chance that a set of random IDs holds a repeat follows the birthday problem.
Here n is the number of IDs and b the random bits in each. For version 4, b is 122, so a 50% chance of a single repeat takes about 2.7 × 10¹⁸ IDs.
Worked examples
Reading the time inside a version 7 UUID
RFC 9562 gives 017f22e2-79b0-7cc3-98c4-dc0c0c07398f as its sample version 7 UUID. The 13th digit is 7, the version. The 17th digit is 9, whose first two bits are 10, the standard variant.
The first 12 digits, 017f22e279b0, are the time: 1,645,557,742,000 milliseconds after the start of 1970, which is 2022-02-22 19:22:22 UTC. Anyone who sees this ID can work out when it was made, to the millisecond.
A version 1 UUID from an older system
The RFC’s version 1 sample is c232ab00-9414-11ec-b3c8-9f6bdeced846. Its time is split across three fields and counts steps of 100 nanoseconds from 15 October 1582. Put back together, it gives 2022-02-22 19:22:22 UTC, the same moment as the version 7 sample.
The last 12 digits, 9f6bdeced846, are the node field. RFC 9562 says it holds a network card address or a random value, so an old version 1 ID can point to the machine that made it. The RFC also says to use version 7 instead of version 1 where possible.
Priya makes 1,000 test keys
Priya needs 1,000 primary keys for a test table. One version 7 batch made at 2026-11-10 09:30:00 UTC gives IDs from 01a1c4ca-fdc0-721e-b1ff-fcf0f4091c27 to 01a1c4ca-fdc0-7605-985a-18c59bd9c635. Sorted as text, they come out in the order they were made, because they share the time and the counter goes up by one.
Checked line by line, 1,000 of them are valid version 7 IDs with that time, and none repeats. Had she used version 4, the chance of any repeat among 1,000 would be 9.4 × 10⁻³², and among a billion still only 9.4 × 10⁻²⁰.
Reading your result
| Digit | Version | What it holds |
|---|---|---|
| 1 | Version 1 | Time and node |
| 3 | Version 3 | MD5 hash of a name |
| 4 | Version 4 | Random bits |
| 5 | Version 5 | SHA-1 hash of a name |
| 6 | Version 6 | Time, reordered to sort |
| 7 | Version 7 | Unix time, then random |
| 8 | Version 8 | Custom layout |
Check the variant first. The version digit only means something when the 17th digit is 8, 9, a or b. Digits 0 to 7 belong to an old NCS layout, c and d to an old Microsoft one, and e and f are reserved.
Version 4 or version 7. Pick version 7 for database keys and logs, where sorting by time keeps new rows close together in an index. Pick version 4 when an ID must not reveal when it was made, such as a public link to a record.
Nil and Max. The Nil UUID is all zeros and the Max UUID is all f digits. Both are reserved values, often used to mean none or the end of a range.
Common mistakes
- Treating a UUID as a password. RFC 9562 says not to assume UUIDs are hard to guess and not to use them as security capabilities, IDs whose mere possession grants access. Use a dedicated random token for sign-in links and API keys.
- Comparing UUIDs as plain text. One system may write uppercase in braces and another lowercase with hyphens. Convert both to one form before you compare, or the same ID looks like two.
- Expecting a v7 batch to sort without a counter. If every ID in a batch shares the same millisecond and the rest is random, the batch sorts in a random order. A counter, as used here, fixes that.
- Using version 1 on a public system. Its node field can hold the network card address of the machine that made it. Version 7 gives the same time ordering without that.
- Writing your own generator with Math.random. A weak random source is the usual cause of real repeats. Use the platform’s cryptographic source, such as crypto.randomUUID in a browser.