A UUID is a 128-bit ID that stays unique without a central authority handing out numbers
A UUID (Universally Unique IDentifier) is a 128-bit, or 16-byte, identifier. It is usually written as 32 hex digits split 8-4-4-4-12, like 0192f3a1-7c4e-7b21-9a3f-5c2d8e1f4a6b. The point is that no server has to hand out sequence numbers: values created independently on different machines are, for practical purposes, never the same. In Microsoft environments the same thing is called a GUID.
The current standard is RFC 9562, published in May 2024, which replaces the long-used RFC 4122. It covers versions 1 through 8, but when you create a new ID you will usually pick one of three. v4 is almost entirely random, v7 puts the creation time at the front so values sort in order, and v5 is name-based, so the same name always produces the same value. This tool generates all three, and for any UUID you paste in, it reads out the version and the timestamp.
When to generate UUIDs yourself
If the database already numbers your rows, why make IDs separately? Because sometimes numbers are assigned in more than one place, or you need the ID before anything is stored.
- Test and sample data: fake data such as 30 users or 200 orders needs many distinct IDs at once. Set a count and paste the result straight in as a JSON array or SQL list.
- IDs decided before saving: an offline app, or a screen that saves in several steps, has to fix IDs before sending anything to the server so the relationships hold. A UUID is unique wherever it is created, so there is no need to wait for a server response.
- Merging data from several sources: tables numbered from 1 at each branch collide when combined. If they used UUIDs from the start, nothing has to be renumbered when you merge.
- File and object names: renaming uploads to UUIDs keeps files with the same original name from overwriting each other.
- Request and job tracing: when one request passes through several services, logging the same UUID in each lets you stitch the scattered records into one trail.
- The same ID for the same thing: for something that already has a unique name, such as an address or a product code, use v5 to always give it the same UUID. Any server computes the same result, so nobody needs to exchange an ID table.
How to use it
- Pick a version at the top. If you are not sure which, see the version comparison below. On first load, 10 v4 UUIDs are already generated.
- For v4 and v7, enter a count (1 to 1,000) and press Generate. The 1, 10, 100 and 1,000 buttons generate that many immediately. For v5, choose a namespace and enter one name per line; each line produces one UUID.
- In the output panel, choose the case (lower or upper), the format (8-4-4-4-12, no hyphens, braces, urn:uuid:) and the output (one per line, JSON array, SQL list). The values stay the same and only the notation changes; what you see in the list is exactly what gets copied and saved.
- Click a row in the list to expand that UUID in the anatomy view. Copy one with the copy icon at the end of the row or the Copy button in the anatomy view, or move the whole list with Copy all or Save file. In the list, use the arrow keys to move and Enter to copy that row.
- To inspect a UUID from somewhere else, paste it into the box above the anatomy view. It also reads braces, urn:uuid:, quotes and 32 digits without hyphens, and shows the version and variant, plus the creation time for v7, v1 and v6.
v4, v7 or v5: which one?
| Version | Built from | Sorted | What the value reveals | Good for |
|---|---|---|---|---|
| v4 | 122 random bits | Scrambled | Nothing | IDs exposed to outsiders, security-related identifiers, most general uses |
| v7 | 48-bit millisecond timestamp + 74 bits of random data (or a counter) | Creation order | Creation time (to the millisecond) | Database primary keys, records that accumulate over time |
| v5 | Namespace UUID + SHA-1 of the name | Scrambled | Anyone who knows the name can recreate the same value | Always giving the same ID to something that already has a unique name (URL, domain, etc.) |
The biggest reason to choose v7 is sorting. RFC 9562 explains that with time-ordered UUIDs, new values land close together in a database index, which improves index locality, and the difference from inserting random values can be 10x or more in practice. On the other hand, the security section of the same document says to use v4 if the UUID is used for security purposes. A v7 carries its creation time as-is, so anyone looking at a public ID can tell when the record was created.
v1 and v6 also carry a timestamp, but they put the device's MAC address in the node field, so RFC 9562 recommends v7 over v1 and v6 whenever possible. v3 is name-based like v5 but uses MD5, and the standard says to use v5 instead of v3 whenever possible. That is why this tool generates only v4, v7 and v5, and reads the other versions only in the inspection box.
How to read a UUID
Within the 36 characters, only two positions are fixed. The 13th character counted without hyphens (the first character of the third group) is the version, and the top two bits of the 17th character (the first character of the fourth group) are the variant. For the RFC 9562 variant the bits are 10, so the 17th character is one of 8, 9, a or b. What fills the remaining 122 bits depends on the version.
| Group | Chars | Bits | v4 | v7 | v5 |
|---|---|---|---|---|---|
| 1 | 8 | 32 | Random | Timestamp (ms), first 32 bits | SHA-1 |
| 2 | 4 | 16 | Random | Timestamp, last 16 bits | SHA-1 |
| 3 | 4 | 16 | Version 4 + 12 random | Version 7 + 12 rand_a | Version 5 + 12 SHA-1 |
| 4 | 4 | 16 | Variant 2 + 14 random | Variant 2 + 14 random | Variant 2 + 14 SHA-1 |
| 5 | 12 | 48 | Random | Random | SHA-1 |
Paste the example values from the RFC 9562 appendix into the inspection box and the anatomy view shows the same layout.
| Version | UUID | What it decodes to |
|---|---|---|
| v4 | 919108f7-52d1-4320-9bac-f847db4148a8 | 13th character 4; 17th character 9 (binary 1001, top two bits 10) |
| v7 | 017f22e2-79b0-7cc3-98c4-dc0c0c07398f | First 12 characters 017f22e279b0 = 1,645,557,742,000 ms = 2022-02-22 19:22:22.000 UTC |
| v5 | 2ed6657d-e927-568b-95e1-2665a8aea6a2 | First 128 bits of SHA-1 over the DNS namespace + www.example.com, with only the version and variant positions overwritten |
The 12 rand_a bits in v7 are up to the generator. They can simply be random, or hold a counter that increases by 1 within the same millisecond, or a finer-grained fraction of time (RFC 9562 6.2). This tool uses the counter approach (Method 1). When a new millisecond starts, the counter begins at an 11-bit random value; within the same millisecond it goes up by 1, and if it passes 4,095 the timestamp is advanced by 1 millisecond. So even when you generate 1,000 at once, list order and string-sort order are the same. The following 62 bits are fresh random data each time.
Formats and lengths
Changing the notation does not change the 128-bit value. Match whatever format the receiving program expects.
| Format | Example | Length | Where it is used |
|---|---|---|---|
| Default (lowercase) | 919108f7-52d1-4320-9bac-f847db4148a8 | 36 | The most common notation; what browser crypto.randomUUID() returns |
| Uppercase | 919108F7-52D1-4320-9BAC-F847DB4148A8 | 36 | Tools that print uppercase, such as macOS uuidgen |
| No hyphens | 919108f752d143209bacf847db4148a8 | 32 | File names, keys that need to be shorter |
| Braces | {919108f7-52d1-4320-9bac-f847db4148a8} | 38 | A form RFC 9562 cites as the output of some implementations, such as Microsoft's |
| URN | urn:uuid:919108f7-52d1-4320-9bac-f847db4148a8 | 45 | Documents and metadata that need a URN |
RFC 9562 says hex digits may be written in uppercase, lowercase or mixed, and it is the same value. But if a program compares UUIDs as plain strings, uppercase and lowercase count as different values. Within one system, stick to a single notation.
How to generate them in code, databases and the terminal
| Environment | v4 | v7 |
|---|---|---|
| Browser, Node.js | crypto.randomUUID() | No built-in |
| Python 3.14 or later | uuid.uuid4() | uuid.uuid7() |
| PostgreSQL 18 | gen_random_uuid(), uuidv4() | uuidv7() |
| .NET 9 or later | Guid.NewGuid() | Guid.CreateVersion7() |
| PowerShell | New-Guid | No built-in |
| macOS terminal | uuidgen | No built-in |
| Linux (util-linux) | uuidgen | uuidgen -7 |
- Browser, Node.js: randomUUID in W3C Web Cryptography produces only v4.
- Python 3.14 or later: 3.14 added uuid6, uuid7 and uuid8; uuid7 keeps order within the same millisecond using a 42-bit counter.
- PostgreSQL 18: read the version and timestamp with
uuid_extract_version(),uuid_extract_timestamp(). - .NET 9 or later: NewGuid produces v4.
- PowerShell: produces a random GUID.
- macOS terminal: prints in uppercase.
- Linux (util-linux): random by default when a good random source is available. Create a v5 with
uuidgen --sha1 --namespace @dns --name www.example.com. Depending on your distribution's util-linux version, -7 may be missing.
How small is the chance of a duplicate?
A v4 has 122 random bits, so there are 2122, about 5.3 × 1036, possible values. The probability that at least one pair matches among n values is approximated with the birthday-problem formula 1 − e−n(n−1)/(2·2122).
| Number generated | Probability |
|---|---|
| 1 million | about 9.4 × 10⁻²⁶ |
| 1 billion | about 9.4 × 10⁻²⁰ |
| 1 trillion | about 9.4 × 10⁻¹⁴ |
| 1 quadrillion | about 9.4 × 10⁻⁸ |
| about 2.7 × 10¹⁸ | 50% |
Reaching a 50% probability takes 2.7 × 1018 values, which would take about 86 years even at a billion per second. This calculation does assume the random numbers are uniformly distributed. That is why RFC 9562 tells you to use a cryptographically secure random number generator, and this tool uses the browser's crypto.getRandomValues(). The probability is not zero, so for production data put a unique constraint on the column and, if a collision makes a save fail, generate a new value and retry.
With v7, only values created in the same millisecond can collide. Within one generator the counter increases, so they never collide; when different devices create values in the same millisecond, the 62 trailing random bits tell them apart.
Using v7 as a database key
- Store them as binary: RFC 9562 notes that storing a UUID as text uses 288 bits for a 128-bit value, so store it as 128-bit binary whenever you can. If there is a dedicated type, such as the
uuidtype in PostgreSQL, use it. - Sort by byte order: v7 values come out in creation order if you compare the bytes from the front, or sort the text alphabetically when it is written in a single case. Mixing uppercase and lowercase breaks the text sort.
- Treat the timestamp as a hint: the first 48 bits of a v7 come from the creating device's clock. RFC 9562 says it does not guarantee how close that time is to real time, and the PostgreSQL documentation says the extracted time is not necessarily identical to the creation time. If you need the exact creation time, keep it in a separate column.
- Let the database generate them: RFC 9562 says that when all data lives in a single database, UUIDs generated by the database preserve order best. Use values from this tool for test data or IDs you have to fix in advance, and for keys that keep accumulating in production, it is better to generate them with a database or server function.
Common mistakes
- Using only the first 8 characters: 8 characters are 32 bits, so the chance of a match reaches 50% at only about 77,000 values. If you want something short, do not treat a truncated value as unique in the way a UUID is.
- Granting access just because someone knows the UUID: the security section of RFC 9562 says not to assume a UUID is hard to guess, and not to use it as a value that grants privilege merely by being held. Even when a UUID is in a shareable URL, you still need a separate permission check.
- Public IDs made with v7: if the user ID in the address bar is a v7, it reveals the sign-up time. Use v4 wherever the time must not be exposed.
- Tiny differences in a v5 name:
www.example.comandwww.example.com., leading or trailing spaces, and case differences are all different names and give different UUIDs. RFC 9562 also explains that the same name can be written in several ways, and each way gives a different UUID. This tool does not alter the name and computes it as typed, in UTF-8. - GUIDs with a different byte order: .NET's
Guid.ToByteArray()returns the bytes of the first three groups in reversed order. As strings they match, but check the order when you move them as bytes. - Name-based UUIDs as primary keys: RFC 9562 says not to use a name-based UUID as a primary key, because values that seem permanent, such as a postal code or a license number, often change later.
Limits and cautions
- It generates up to 1,000 at a time. For v5, up to 1,000 name lines are processed.
- The v7 ordering holds only within this page. Order against values created in the same millisecond in another tab or on another device is not guaranteed.
- The v7 timestamp uses this device's clock. If the device clock is wrong, the time inside the UUID is wrong too.
- v5 uses SHA-1. RFC 9562 says a name-based UUID made with another hash such as SHA-256 should be a v8, not a v5, and this tool does not generate v8.
- v1, v3, v6 and v8 are read-only in the inspection box. The node value in v1 and v6 may be the device's MAC address.
- Generated UUIDs disappear when you reload. Copy the list or save it to a file if you need it.
Sources
As of The RFC 9562, W3C Web Cryptography, PostgreSQL 18, Python, .NET, PowerShell and util-linux documentation were checked against the originals on October 22, 2026. The v4, v7 and v5 values in the example tables were cross-checked to give the same results in this tool and in Python 3.14's uuid module, and the probability table was calculated with the formula above.
- 01IETF RFC 9562 — Universally Unique IDentifiers (UUIDs)May 2024, replaces RFC 4122. Section 4 notation, 5.4 v4, 5.5 v5, 5.7 v7, 6.2 monotonicity, 6.11 sorting, 6.13 databases, section 8 security, Appendix A examples
- 02W3C — Web Cryptography API, randomUUIDThe procedure that produces a version 4 UUID as a lowercase string
- 03PostgreSQL 18 — 9.14 UUID Functionsgen_random_uuid, uuidv4, uuidv7, uuid_extract_timestamp, uuid_extract_version
- 04Python documentation — uuiduuid6, uuid7 and uuid8 added in 3.14; uuid7's 42-bit counter
- 05Microsoft Learn — Guid.CreateVersion7Since .NET 9, RFC 9562 version 7
- 06Microsoft Learn — Guid.NewGuidVersion 4 UUID, 122 bits of entropy
- 07Microsoft Learn — Guid.ToByteArrayReverses the order of the first four-byte group and the next two two-byte groups
- 08Microsoft Learn — New-GuidThe PowerShell command that creates a random GUID
- 09uuidgen(1) — util-linux manualRandom by default, -7 (--time-v7), --sha1 --namespace @dns
Frequently asked questions
Should I use UUID v4 or v7?
v7 is the right choice where new values are best added in order at the end of an index, such as database primary keys. The first 48 bits are the creation time, so even a string sort gives creation order. Use v4 for values that must not reveal when they were created and for security-related identifiers. RFC 9562 also says to use v4 if the UUID is used for security purposes.
How many characters is a UUID?
The standard notation is 36 characters: 32 hex digits plus 4 hyphens. Without hyphens it is 32, with braces it is 38, and with a urn:uuid: prefix it is 45. The value itself is 128 bits, or 16 bytes.
How do I check a UUID's version?
The version is the first character of the third group, that is, the 13th character counted without hyphens. If the first character of the fourth group is 8, 9, a or b, it is the RFC 9562 variant. Paste a UUID into this tool's inspection box and it reads the version and variant, plus the creation time for v7, v1 and v6.
How likely is a duplicate UUID v4?
A v4 has 122 random bits, so even after generating 1 billion, the chance that any two match is only about 9.4 × 10⁻²⁰. It would take about 2.7 × 10¹⁸ values to reach a 50% chance of a collision. It is not zero, so for production data also add a unique constraint.
Can I tell when a UUID v7 was created?
Yes. The first 12 characters (48 bits) are the milliseconds counted from January 1, 1970 UTC. Paste it into the inspection box and it shows the time in your device's time zone and in UTC. However, the value simply carries the clock of the device that created it, so it cannot be trusted as an exact record time.
When should I use UUID v5?
Use it when you need the same UUID from the same name every time. The namespace UUID and the name are concatenated, hashed with SHA-1, and the first 128 bits are used. For example, the DNS namespace and www.example.com give 2ed6657d-e927-568b-95e1-2665a8aea6a2 wherever you compute it. A single changed character gives a completely different value.
Can I use a UUID as a password or auth token?
No. RFC 9562 says not to assume a UUID is hard to guess, and not to use it as a value that grants access merely by being held. Even a URL that contains a UUID needs a permission check, and secret tokens should be issued separately by a method suited to the purpose.
Are a GUID and a UUID different?
They are two names for the same 128-bit identifier. RFC 9562 also notes that a UUID is sometimes called a GUID. However, the Microsoft form uses little-endian when stored as binary. For example, .NET's Guid.ToByteArray() returns the first four-byte group and the next two two-byte groups in reversed order, so check the byte order when you exchange them as bytes.