UUID Generator

Create universally unique identifiers (UUIDs, also called GUIDs) one at a time or in bulk, as version 4 or version 7.

Format

🔒 Runs entirely in your browser. Nothing you enter is sent to a server.

A UUID (universally unique identifier) is a 128-bit label that you can create anywhere, at any time, without checking a central registry, and still be confident nobody else has the same one. Developers use them as database keys, file names, request IDs and anywhere else an ID must never clash. This generator creates them instantly, one at a time or a thousand at once.

How to use the UUID generator

  1. Choose a version. Version 4 is random. Version 7 starts with a timestamp so that IDs sort by creation time.
  2. Set how many you need, from 1 to 1,000.
  3. Pick a format: uppercase, with or without hyphens, or wrapped in braces as some Microsoft tools expect.
  4. Click Copy all or Download .txt.

A fresh set is generated whenever you change an option or click Generate again.

What a UUID looks like

A UUID is written as 32 hexadecimal digits in five groups separated by hyphens:

f47ac10b-58cc-4372-a567-0e02b2c3d479
xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx
  • M is the version. In the example above it is 4.
  • N is the variant. For standard UUIDs it is always 8, 9, a or b.

That leaves 122 bits of a version 4 UUID free for random data.

How version 4 is built

  1. Fill 16 bytes (128 bits) with secure random data.
  2. Set the top four bits of byte 6 to 0100, which marks version 4.
  3. Set the top two bits of byte 8 to 10, which marks the standard variant.
  4. Write the bytes as hex in the 8-4-4-4-12 pattern.

How version 7 is built

Version 7, defined in RFC 9562 (2024), puts the time first:

  • The first 48 bits are the Unix timestamp in milliseconds.
  • The next 4 bits are the version, 0111.
  • The rest are random, apart from the 2 variant bits.

Because the timestamp comes first, sorting v7 UUIDs as text also sorts them by creation time. This generator also keeps UUIDs made in the same millisecond in order.

How unlikely is a duplicate?

With 122 random bits there are about 5.3 × 10³⁶ possible v4 UUIDs. Using the birthday problem, the chance of any collision among n UUIDs is roughly:

p ≈ n² ÷ (2 × 2^122)

Worked example

Suppose you generate one billion (10⁹) UUIDs:

  • n² = 10¹⁸
  • 2 × 2^122 ≈ 1.06 × 10³⁷
  • p ≈ 10¹⁸ ÷ 1.06 × 10³⁷ ≈ 9.4 × 10⁻²⁰

That is less than one chance in ten quintillion. Hardware faults are vastly more likely than a UUID collision.

v4 or v7: which should you use?

Version 4 Version 7
Content Random Timestamp plus random
Sortable by creation time No Yes
Reveals when it was created No Yes, to the millisecond
Best for Public IDs, tokens, file names Database primary keys, logs, events

Random v4 keys land in random places in a database index, which can slow inserts on very large tables. v7 keys are added at the end, much like an auto-increment number, but can still be created by any server without coordination.

Tips and pitfalls

  • Store UUIDs as binary when you can. A native UUID column or 16-byte binary uses less than half the space of a 36-character string.
  • Do not rely on secrecy. A v7 UUID reveals its creation time, and any UUID can leak through logs or URLs. Use proper authorisation checks.
  • Compare in lowercase. The standard says UUIDs are case-insensitive, but string comparisons in code are not. Pick one case and normalise.
  • The nil UUID is a placeholder. All zeros means “no value” in some systems. Never use it as a real ID.

Frequently asked questions

What is the difference between a UUID and a GUID?

They are the same thing. GUID (globally unique identifier) is the name Microsoft uses, and UUID (universally unique identifier) is the name used in the standard. Both are 128-bit values written as 32 hexadecimal digits.

Can two UUIDs ever be the same?

In theory yes, in practice no. A version 4 UUID has 122 random bits. You would need to generate about 2.7 quintillion of them to have even a 50% chance of a single duplicate.

Should I use version 4 or version 7?

Use v4 when you just need a unique, unguessable identifier. Use v7 for database primary keys, because v7 UUIDs sort in creation order, which keeps database indexes compact and inserts fast.

Are these UUIDs secure enough for tokens?

They are generated with your browser's cryptographically secure random number generator. Even so, UUIDs are designed to be unique, not secret. For session tokens or password reset links, use a dedicated token with at least 128 random bits from your back end.

Are the UUIDs stored anywhere?

No. They are created in your browser and never sent to a server, so nobody else ever sees them.

Last updated October 28, 2026 · By the ZTool team