About the UUID Generator
A UUID (universally unique identifier, also called a GUID) is a 128-bit ID written as 32 hex digits in five groups, like 919108f7-52d1-4320-9bac-f847db4148a8. Because the chance of two random UUIDs ever colliding is negligible, any system can create IDs on its own without asking a central database for the next number.
The UUID Generator follows RFC 9562, the current UUID standard. It makes random version 4 UUIDs, time-sortable version 7 UUIDs that work well as database keys, classic version 1 UUIDs, and name-based version 3 and 5 UUIDs that always give the same result for the same input. Generate up to 1,000 at a time in standard, uppercase, compact, braced or URN format.
The inspector works the other way around: paste any UUID and it tells you its version and variant, and for time-based UUIDs, the exact moment it was created. Random values come from your browser's cryptographic generator, and nothing is sent anywhere.
How to use it
- Choose a versionVersion 4 is the usual choice. Pick version 7 for database keys that sort by time, version 1 for older systems, or version 3 or 5 for IDs derived from a name.
- Set the format and countChoose Standard, Uppercase, No hyphens, With braces {} or URN, and how many UUIDs you want, from 1 to 1,000.
- For versions 3 and 5, enter a namePick a namespace (DNS, URL, OID, X.500 or your own UUID) and type the name, such as a domain or a URL.
- Copy or downloadCopy all UUIDs at once or download them as uuids.txt, one per line. Generate makes a new batch.
- Inspect a UUIDPaste any UUID, with or without hyphens, braces or urn:uuid:, to see its version, variant and, for versions 1, 6 and 7, when it was created.
Key features
All common versions
Versions 1, 3, 4, 5 and 7, plus the Nil UUID, all built to RFC 9562.
Cryptographically random
Random bits come from crypto.getRandomValues, so version 4 and 7 UUIDs are unpredictable.
Sortable version 7
Version 7 UUIDs start with a millisecond timestamp, and a counter keeps UUIDs made in the same millisecond in order.
Name-based IDs
Versions 3 (MD5) and 5 (SHA-1) turn a namespace and a name into the same UUID every time, in any language.
Five output formats
Lowercase with hyphens, uppercase, 32 digits without hyphens, {braced} for Microsoft tools, or urn:uuid: for XML and RDF.
UUID inspector
Shows the version and variant of any UUID, and the creation time, clock sequence and node of time-based ones.
Examples
Version 4 (random)
With the defaults, you get 10 random UUIDs and the status line reads 10 UUIDs. Each one looks like this:
5cc63acb-b69a-4f90-b796-312eb81db2e4
The 4 at the start of the third group is the version. The first digit of the fourth group is always 8, 9, a or b, which marks the RFC variant. The other 122 bits are random.
Version 7 (time-sortable)
Five version 7 UUIDs made in the same millisecond:
01a11334-2d9c-7097-a5ed-5e58c2a78d1e
01a11334-2d9c-7098-8a6a-50b3dbad9294
01a11334-2d9c-7099-818c-be6d5c0ca0a0
01a11334-2d9c-709a-8e90-408e0810a433
01a11334-2d9c-709b-8c2f-083b4c4dcd7f
The first 12 hex digits are the time in milliseconds, so the UUIDs share them, and the counter that follows the 7 counts up by one. Sorted as text, they stay in creation order, which keeps database indexes compact.
Versions 3 and 5 (name-based)
| Version | Namespace and name | UUID |
|---|---|---|
| 5 | DNS, www.example.com | 2ed6657d-e927-568b-95e1-2665a8aea6a2 |
| 3 | DNS, www.example.com | 5df41881-3aed-3515-88a7-2f4a814cf09e |
| 5 | URL, https://example.com | 4fd35a71-71ef-5a55-a9d9-aa75c889a6d0 |
The first two are the test values from RFC 9562, and all three match what Python's uuid module produces. The status line reminds you that the same namespace and name always give the same UUID.
Inspecting UUIDs
The RFC 9562 example 017f22e2-79b0-7cc3-98c4-dc0c0c07398f is shown as Version 7 (Unix time, sortable), variant RFC 9562, created 2022-02-22 19:22:22.000 UTC, followed by the same moment in your local time.
The version 1 example C232AB00-9414-11EC-B3C8-9F6BDECED846 has the same creation time, plus clock sequence 13256 and node 9f:6b:de:ce:d8:46. A version 4 UUID shows "Made from: 122 random bits", and anything that is not 32 hex digits is reported as not a valid UUID.
Formats
The same UUID in each format: 39e87510-c1d0-11f1-8664-6f46bace915a (Standard), 39E87510-C1D0-11F1-8664-6F46BACE915A (Uppercase), {39e87510-c1d0-11f1-8664-6f46bace915a} (With braces) and urn:uuid:39e87510-c1d0-11f1-8664-6f46bace915a (URN). No hyphens gives the 32 digits on their own.
Tips
- Use version 7 for primary keys in databases. Random version 4 keys are scattered across the index, which slows down inserts on large tables.
- Use version 5 instead of 3 for new name-based IDs. Both are deterministic, but version 5 uses SHA-1 instead of MD5.
- Store UUIDs as a native uuid type or as 16 bytes when your database supports it. As text they take 36 bytes plus overhead.
- Compare UUIDs without regard to case. abc and ABC are the same UUID; most libraries output lowercase.
- Paste an unfamiliar ID into the inspector to find out what made it and, for version 1 and 7 IDs, when it was created.
Common mistakes and limits
- Using UUIDs as secretsA UUID is an identifier, not a password or token. Version 1 and 7 UUIDs reveal when they were created, and even version 4 should not replace a proper secret token.
- Expecting version 3 or 5 to be randomName-based UUIDs are the same every time for the same namespace and name. That is their purpose, but anyone who knows the name can compute the UUID.
- Assuming version 4 sorts by timeRandom UUIDs have no order. If you need IDs in creation order, use version 7.
- Treating version 1 as privateClassic version 1 UUIDs contain a node ID that was traditionally the computer's MAC address. This tool uses a random node instead, but UUIDs from other systems may reveal hardware.
- Changing the format by handEditing UUIDs by hand risks typos. Pick the format here, so braces, URN prefixes and case are always right.