What Is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit number used to label things like database rows, files, API requests and devices without asking a central server for the next free ID. It's written as 32 hexadecimal digits in five groups, 8-4-4-4-12, for example f47ac10b-58cc-4372-a567-0e02b2c3d479.
UUIDs are defined in RFC 9562 (2024), which replaced the older RFC 4122 and added versions 6, 7 and 8. The first hex digit of the third group tells you the version (the 4 in 4372 above), and the first digit of the fourth group shows the variant (8, 9, a or b for standard UUIDs).

UUID Versions Explained
Every version fills the same 128 bits differently. These are the ones you'll actually meet:
122 random bits. No meaning inside, nothing to leak. The default in most languages (crypto.randomUUID(), uuid.uuid4(), Guid.NewGuid()).
A 48-bit Unix timestamp in milliseconds followed by random bits, so new IDs sort after old ones. RFC 9562 recommends it over v1 and v6.
A 60-bit timestamp, a clock sequence and a 48-bit node ID that was originally the computer's MAC address. Our generator uses a random node instead.
A namespace UUID plus a name, hashed with SHA-1 (v5) or MD5 (v3). The same input always gives the same UUID. Prefer v5.
Version 1's fields rearranged so the IDs sort by time. Mostly a bridge for systems that already use v1.
All zeros (00000000-0000-0000-0000-000000000000) or all f. Used as placeholders for "no value" or "end of range".
Advertisement
How to Generate a UUID
v4 for a random ID, v7 if the IDs go into a database index or should sort by creation time, v5 if the same name must always map to the same UUID.
Generate 1, 10, 100 or up to 1,000 at once. Each one comes from the browser's cryptographically secure random generator.
Standard lowercase, {braces} and uppercase for Windows-style GUIDs, 32 characters without hyphens, or a urn:uuid: URN.
Copy a single UUID or the whole list, or download it as a .txt file. The page address keeps your settings, so you can bookmark them.
UUID vs GUID: Is There a Difference?
GUID (Globally Unique Identifier) is Microsoft's name for the same thing. A GUID made by Guid.NewGuid() in .NET or New-Guid in PowerShell is a standard version 4 UUID.
The visible difference is how they're usually written: Windows tools often show GUIDs in uppercase and wrapped in braces, like {F47AC10B-58CC-4372-A567-0E02B2C3D479}. Set the format to Braces and tick Uppercase to get exactly that. Under the hood, Windows and .NET store the first three groups in little-endian byte order, so the raw 16 bytes differ from the UUID byte order even when the text is identical. Some very old COM GUIDs use Microsoft's own variant bits, which the decoder above labels.
Advertisement
UUID v4 vs v7: Which Should You Use?
Both are safe to use as unique IDs. The difference is what happens when you store millions of them in a database index.
Use v7 for primary keys. Because each new v7 UUID is larger than the last, inserts land at the end of a B-tree index instead of at random places, which keeps indexes compact and inserts fast in PostgreSQL and MySQL. SQL Server is the exception: it sorts
uniqueidentifiervalues by their last six bytes first, so v7 gives no such benefit there.Use v4 when the ID must not reveal anything. A v7 UUID contains its creation time to the millisecond; anyone who sees it can read that time with the decoder above.
Use v5 for stable IDs from names, for example one UUID per domain name or URL, so every system computes the same value without sharing a table.
Avoid v1 for new work. Classic v1 embeds the machine's MAC address and creation time; RFC 9562 recommends v7 instead.
Can Two UUIDs Ever Be the Same?
In theory yes, in practice no. A version 4 UUID has 122 random bits, about 5.3 × 10^36 possible values. You would need to generate around 2.7 quintillion (2.7 × 10^18) of them before there's even a 50% chance of a single duplicate. That's one billion UUIDs every second for about 86 years.
The real risk is a broken random number generator, not the maths. This tool uses crypto.getRandomValues(), the browser's cryptographically secure source, and v7 keeps a counter so UUIDs created in the same millisecond still sort correctly and never repeat.
Advertisement
Decode a UUID: Version, Variant and Timestamp
Open the Decode tab and paste one or more UUIDs, one per line, in standard, braced, urn:uuid: or 32-character form. For each one you'll see whether it's valid, its version and variant and, for v1, v6 and v7, the date and time it was created.
For v1 and v6 UUIDs the decoder also shows the node ID and whether it looks like a real MAC address or a random value. That's a quick way to check whether old IDs in your system are leaking hardware addresses.
Generate a UUID in Code
Most major languages and databases can create UUIDs without extra packages. Version 7 support is newer: Python 3.14, PostgreSQL 18, .NET 9 and Go 1.27 added it.
crypto.randomUUID()
// 'f47ac10b-58cc-4372-a567-0e02b2c3d479' (version 4)import uuid
uuid.uuid4() # random
uuid.uuid5(uuid.NAMESPACE_DNS, 'example.com') # name-based, always the same
uuid.uuid7() # Python 3.14+SELECT gen_random_uuid(); -- version 4 (PostgreSQL 13+)
SELECT uuidv7(); -- version 7 (PostgreSQL 18+)Guid.NewGuid() // version 4
Guid.CreateVersion7() // version 7 (.NET 9+)
# PowerShell
New-Guiduuidgen # random UUID (macOS prints uppercase)
uuidgen --time # version 1 (util-linux)
cat /proc/sys/kernel/random/uuid # Linux kernelUUID.randomUUID() // Java, version 4
uuid.NewV4() // Go 1.27+ standard library, version 4
uuid.NewV7() // Go 1.27+, version 7
// older Go: github.com/google/uuid (uuid.New, uuid.NewV7)Advertisement
More Developer Tools
Other free tools for developers and system admins, all running in your browser: