Free tool

UUID generator: v4, v7, ULID and GUID

Get random v4 UUIDs, time-ordered v7 UUIDs, name-based v5 UUIDs, ULIDs or Nano IDs, from one to 10,000 at a time, as plain lines, JSON, a quoted list or SQL. Paste any UUID below the generator to see its version, variant and the time inside it.

Free · no sign-up · runs in your browser, nothing is uploaded

Options
Type

122 random bits. The default choice when you just need a unique ID.

Format

Shortcuts: R new IDs, C copy all.

0 UUIDs

Generating…

Decode / validate a UUID or ULID

UUID versions compared

Every UUID is 128 bits. The version says how those bits were made. RFC 9562 (May 2024) replaced RFC 4122, kept versions 1 to 5 and added 6, 7 and 8. ULID and Nano ID are not UUIDs, but they solve the same problem and are included here because people often compare them.

TypeWhat is insideSorts by timeGood for
v160-bit time (100 ns since 1582) + clock sequence + nodeNoLegacy systems. Can leak a MAC address.
v3MD5 of namespace + nameNoMatching existing v3 IDs only
v4122 random bitsNoGeneral unique IDs
v5SHA-1 of namespace + nameNoStable IDs from a URL, email or key
v6v1 fields, reordered with the time firstYesUpgrading v1 systems
v748-bit Unix ms + 74 random bitsYesDatabase primary keys, event IDs
v8Vendor-defined layoutDependsCustom schemes (not generated here)
Nil / MaxAll 0 bits / all 1 bitsn/a"No value" and "largest value" sentinels
ULID48-bit Unix ms + 80 random bits, Base32YesShort sortable IDs in URLs and logs
Nano IDRandom symbols from an alphabet (21 by default)NoShort public IDs, slugs

UUID v4 or v7 for a database key?

A v4 UUID is fully random, so each new row lands at a random place in a B-tree index. On large tables that means more page splits and a cache that holds less of the index. A v7 UUID starts with the current time in milliseconds, so new rows are added near the end of the index, much like an auto-increment number.

Within one millisecond RFC 9562 lets a generator add a counter or increase the random part so the order still holds. This tool does that: a batch of 10,000 v7 UUIDs made in the same millisecond is still in sorted order. The cost of v7 is that the creation time is readable by anyone who sees the ID.

Many tools now make v7 natively: uuidv7() in PostgreSQL 18, uuid.uuid7() in Python 3.14, Guid.CreateVersion7() in .NET 9 and uuid.NewV7() in Go's google/uuid.

How to read a UUID

A UUID is written as 32 hex digits in five groups, 8-4-4-4-12. Two digits tell you what kind it is without decoding anything:

018f3a9c-7d2e-7b41-9f0c-3e5a8d1b2c47
              ^    ^
              |    variant: 8, 9, a or b = the RFC 9562 layout
              version: 7

The first digit of the third group is the version (1 to 8). The first digit of the fourth group holds the variant; for standard UUIDs it is always 8, 9, a or b. A string with a c or d there is an old Microsoft-variant GUID, and a 0 to 7 is the even older NCS variant. The decoder above checks both digits and pulls out the timestamp for v1, v6, v7 and ULID.

Generate a UUID in code

Most languages have a built-in way to make a v4 UUID, and newer versions add v7.

// JavaScript (browsers in secure contexts, Node.js 19+ as a global)
crypto.randomUUID();                 // v4

# Python
import uuid
uuid.uuid4()                         # random
uuid.uuid5(uuid.NAMESPACE_DNS, "example.com")
uuid.uuid7()                         # Python 3.14+

// Go (github.com/google/uuid)
id := uuid.New()                     // v4
id7, err := uuid.NewV7()

-- PostgreSQL
SELECT gen_random_uuid();            -- v4, built in since 13
SELECT uuidv7();                     -- PostgreSQL 18+

// C#
Guid.NewGuid();                      // v4
Guid.CreateVersion7();               // .NET 9+

# Shell (macOS prints uppercase, Linux lowercase)
uuidgen
cat /proc/sys/kernel/random/uuid     # Linux

For ULIDs and Nano IDs, use the ulid and nanoid packages in JavaScript. If you need UUIDs as test data in bulk, the mock data generator can put them in a column next to names, emails and dates.

GUIDs and the byte-order trap

A GUID is the same 128-bit value as a UUID, and the text form is identical apart from the habit of braces and uppercase, which the {GUID} format and the Uppercase switch above give you. The trap is binary: .NET's Guid.ToByteArray() and SQL Server write the first three groups in little-endian order.

Text:          00112233-4455-6677-8899-aabbccddeeff
RFC 9562 bytes: 00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff
.NET bytes:     33 22 11 00 55 44 77 66 88 99 aa bb cc dd ee ff

So if a UUID looks scrambled after moving between a .NET service and another system through a 16-byte binary column, the first 8 bytes were swapped. Pass UUIDs as text between systems, or convert the byte order on purpose. SQL Server also sorts uniqueidentifier values by the last group first, so v7 values do not sort by time there unless you store them another way.

How unique is a random UUID?

A v4 UUID has 122 random bits, which is about 5.3 × 1036 possible values. By the birthday rule, the number of IDs you need before there is a 50% chance of any duplicate is about √(2 · ln 2 · 2122), roughly 2.7 × 1018. Generating a billion per second, that takes about 85 years.

v7 has fewer random bits (74) but they only need to be unique within the same millisecond, which is a far smaller pool. A Nano ID with the default 21 characters from 64 symbols has 126 random bits, slightly more than v4. Shorter Nano IDs lose 6 bits per character removed; the tool shows the bit count as you change the length. For generating secrets rather than IDs, use the password generator; to turn a v7 or ULID time into a date, the Unix timestamp converter reads milliseconds too. Building a data-heavy app? Browse database tools on DevHunt.

FAQ

Which UUID version should I use?+

Use v4 when you only need a unique random ID. Use v7 for database primary keys and anything you want sorted by creation time. Use v5 when the same input must always map to the same UUID, for example a URL or an email address. v1, v3 and v6 are mainly for compatibility with older systems.

What is the difference between a UUID and a GUID?+

Nothing in practice. GUID is Microsoft's name for the same 128-bit identifier, and RFC 9562 says so. Windows tools tend to print GUIDs in uppercase and inside braces, like {3F2504E0-4F89-41D3-9A0C-0305E82C3301}, but the value is the same. The one real difference is how .NET stores a GUID as bytes (see the section above).

Can two UUIDs ever be the same?+

In theory yes, in practice no, as long as they come from a good random source. A v4 UUID has 122 random bits, so you would need to make about 2.7 quintillion of them before there is a 50% chance of a single duplicate. Real duplicates come from bugs, such as a badly seeded random generator or copying an ID.

How long is a UUID?+

128 bits, which is 16 bytes. Written out it is 36 characters: 32 hex digits plus 4 hyphens in groups of 8-4-4-4-12. Without hyphens it is 32 characters, in Base64 it is 24 (22 without padding), and as a ULID it is 26.

Are UUIDs case-sensitive?+

No. RFC 9562 says the hex digits are case-insensitive when read and should be written in lowercase. So 2ED6657D-… and 2ed6657d-… are the same UUID. If you store UUIDs as text, normalize the case first, or use a native uuid column type so the database does it for you.

Is it safe to use a UUID as a secret token?+

Not as a rule. RFC 9562 says not to assume UUIDs are hard to guess and not to use them as security capabilities. A v4 from crypto.randomUUID() has 122 random bits, but v1, v6 and v7 contain a timestamp and v3/v5 are derived from a name. For session tokens or reset links, use a random token made for the job.

What is a UUID used for?+

A UUID names something so that no other system will pick the same name, without asking a central server. Common uses are database primary keys, order and event IDs, file names, message IDs in queues and keys that are created offline and merged later.

Can you decode a UUID?+

Partly. Any UUID tells you its version and variant. v1, v6 and v7 also contain the time they were made, and v1 and v6 a clock sequence and node. v4 is pure randomness, and v3 and v5 are hashes, so the name behind them cannot be recovered. Paste a UUID in the decoder above to see what it holds. These IDs are made in your browser with crypto.getRandomValues and are never sent anywhere.

Sources: RFC 9562 (UUIDs) · ULID spec · Nano ID · MDN: crypto.randomUUID() · Python uuid · Go google/uuid · PostgreSQL UUID functions · .NET Guid.CreateVersion7 · .NET Guid.ToByteArray. Checked 2026-10-30.