UUID Generator
v4 · v7 · v1 · v5 · v3
Version & Generate

Version 4: 122 random bits. The usual choice when you just need a unique ID.

0 UUIDs
Decode & validate a UUID
Paste a UUID to see its version, variant and time.

UUID versions compared

All UUIDs have the same 128-bit format. The version digit says how the other bits were made:

VersionHow it is madeSorted by time?Good for
v4122 random bitsNoAlmost everything: IDs, tokens in URLs, file names
v7Unix time in ms + random bitsYesDatabase primary keys, event and log IDs
v1Time in 100 ns steps + clock sequence + node (MAC)Not as textOld systems that expect v1; prefer v7 for new work
v6v1 with the time bits reorderedYesMoving a v1 system to sortable IDs
v5SHA-1 of namespace + nameNoStable IDs from a URL, domain or email
v3MD5 of namespace + nameNoSame as v5, only for compatibility
v8Custom layout chosen by the vendorDependsSpecial formats
Nil / MaxAll zeros / all ones–"No value" and "highest value" markers

The decoder above reads all of them, including v6, v8, nil and max. It also shows the variant, so you can see when a value is a Microsoft or old NCS GUID instead of a standard UUID.

What a UUID looks like

Every UUID has 36 characters: 32 hexadecimal digits (0–9, a–f) in five groups of 8, 4, 4, 4 and 12, separated by dashes. Two digits have a fixed meaning:

  • M is the version: 4 for a random UUID, 7 for a time-ordered one, 5 for a name-based one, and so on.
  • N is the variant. For standard UUIDs (RFC 9562, formerly RFC 4122) it is always 8, 9, a or b.
  • In a v4 UUID, all other 122 bits are random.

Without dashes, the same UUID is a 32-character string, for example 3f2b8c1e9d4a4e7ba1c25f6e7d8c9b0a. Windows often shows it in braces and upper case: {3F2B8C1E-9D4A-4E7B-A1C2-5F6E7D8C9B0A}.

UUID v7: time-ordered IDs for databases

The first 12 hex digits (t) are the Unix time in milliseconds, so UUIDs made later sort after UUIDs made earlier, both as text and as bytes. The rest is random. This matters for databases: a random v4 key puts each new row at a random place in the index, while v7 keys are added at the end, which keeps the index small and inserts fast.

This page keeps a batch in order even when many UUIDs are made in the same millisecond: it uses the next 12 bits as a counter (method 1 in RFC 9562). Many platforms now have v7 built in, for example uuidv7() in PostgreSQL 18, uuid.uuid7() in Python 3.14, Guid.CreateVersion7() in .NET 9 and v7() in the uuid package for Node.js.

Privacy note: anyone can read the creation time from a v7 UUID with the decoder above. If the time must stay hidden, use v4.

Name-based UUIDs: v5 and v3

A name-based UUID is a hash of a namespace UUID and a name. v5 uses SHA-1 and v3 uses MD5. The result is always the same for the same input, so two systems can agree on an ID without talking to each other. For example, v5 with the DNS namespace and the name geektools.net is always 930cc21e-6cb4-545b-8e5d-096422d7499f.

  • Use the standard namespaces for their kind of name: DNS for domain names, URL for full URLs, OID for object identifiers and X.500 for directory names.
  • For your own kinds of names (user emails, product codes), make one random v4 UUID once, keep it in your code, and use it as a custom namespace.
  • Prefer v5. Use v3 only when another system already uses it. The name is read as UTF-8 text, the same as Python's uuid.uuid5() and the Node.js uuid package.

Name-based UUIDs are not secret and not random: anyone who knows the name can compute the UUID. To check the hash yourself, see the Hash Generator.

When to use a UUID

Use a UUID when you need an ID that is unique everywhere, not just inside one database table. Typical uses are primary keys in distributed databases, IDs that apps create offline before they sync, file and upload names, request and trace IDs in logs, and idempotency keys for payment APIs.

For a new table, v7 is the best default primary key. For IDs that appear in public URLs and should not reveal when something was made, use v4.

Frequently asked questions

What is a UUID?

A UUID (universally unique identifier) is a 128-bit number used to label things like database rows, files, API requests or devices. It is written as 32 hexadecimal digits in five groups, for example 3f2b8c1e-9d4a-4e7b-a1c2-5f6e7d8c9b0a. Anyone can create one without asking a central server, and it will still be unique in practice.

What is UUID v7?

UUID version 7 (RFC 9562, 2024) starts with the current Unix time in milliseconds (48 bits), followed by the version digit 7 and 74 random bits. Because the time comes first, v7 UUIDs sort in the order they were created, which keeps database indexes compact and inserts fast. They are still unique without a central server.

Should I use UUID v4 or UUID v7?

Use v7 for database primary keys and anything you want sorted by creation time: new rows land at the end of the index instead of at random places. Use v4 when the ID must not reveal anything, because a v7 UUID shows when it was made (to the millisecond). Both are equally unique in practice.

How do I get the date and time from a UUID?

Only time-based UUIDs contain a time: v1, v6 and v7. Paste the UUID into the decoder on this page to see the time in UTC and your local time. In a v7 UUID the first 12 hex digits are the Unix time in milliseconds. In v1 the time is split over the first three groups and counts 100-nanosecond steps since 15 October 1582. Random v4 and name-based v3 / v5 UUIDs have no time inside.

What are name-based UUIDs (v3 and v5)?

A v5 UUID is the SHA-1 hash of a namespace UUID plus a name, and v3 uses MD5 instead. The same namespace and name always give the same UUID, on any computer, so you can turn a URL, domain or email into a stable ID without storing a table. Prefer v5. They are not secret: anyone who knows the name can compute the UUID.

What is the difference between a UUID and a GUID?

There is no real difference. GUID (globally unique identifier) is the name Microsoft uses, for example in Windows, .NET and SQL Server. The format is the same, so the UUIDs from this page work anywhere a GUID is expected. Tick Braces to get the {...} form that some Windows tools show.

Can two UUID v4 values ever be the same?

In theory yes, in practice no. A version 4 UUID has 122 random bits. You would need to create about 2.7 quintillion (2.7 × 10^18) UUIDs before there is even a 50% chance that two of them match.

Are these UUIDs safe to use?

Yes. They are made in your browser with the Web Crypto API, which uses a cryptographically secure random number generator. Nothing is sent to a server and nothing is stored, so no one else sees your UUIDs.

How many UUIDs can I generate at once?

Up to 1,000 per click. For v5 and v3, enter up to 1,000 names, one per line, and you get one UUID per name. Click Copy All to copy them, one per line.

More developer tools