UUID generator (v4 and v7)

Generate up to 1,000 UUIDs at once: random version 4, or version 7, which starts with a timestamp so IDs sort by creation time. Choose upper case, no hyphens or braces, then copy or download the list. Paste any UUID into the inspector to see its version, variant and, for v1 and v7, when it was made.

Free, no sign-up Runs in your browser

Generate

Validate and inspect a UUID

What is a UUID?

A UUID (universally unique identifier) is a 128-bit number used as an ID. Microsoft calls it a GUID. It is written as 32 hex digits in five groups, 8-4-4-4-12:

0190f4d2-6b3a-7c41-9a2e-5f1c8d7e4b90
              ^    ^
        version    variant

The first digit of the third group is the version. The first digit of the fourth group shows the variant. For standard UUIDs it is 8, 9, a or b, which means the bits 10. UUIDs are defined in RFC 9562 (2024), which replaced RFC 4122.

Any computer can create UUIDs without asking a central server, and they will not clash in practice. That makes them useful for database keys, file names, request IDs and offline apps that sync later.

UUID v4 vs v7 vs v1

VersionMade fromSortable by timeUse it for
v160-bit timestamp, clock sequence, MAC addressNo (time fields are in a mixed order)Legacy systems. It can reveal the machine and the time.
v4122 random bitsNoGeneral IDs, tokens that must not be guessable from each other.
v748-bit Unix time in milliseconds, then 74 random bitsYesDatabase primary keys, event and log IDs.

Version 7 is laid out like this. The tool sets the version and variant bits exactly as RFC 9562 says.

| 48 bits: Unix ms | 4: ver=0111 | 12: rand_a | 2: var=10 | 62: rand_b |

When several v7 UUIDs are made in the same millisecond, this tool increases the random part by a random step. So each list comes out in strict ascending order, as RFC 9562 allows.

Can two UUIDs collide?

A v4 UUID has 128 bits, but 6 are fixed (4 for the version and 2 for the variant). That leaves 122 random bits, or 2122 ≈ 5.3 × 1036 possible values.

The birthday problem gives the chance that any two of n random UUIDs match:

p ≈ n² ÷ (2 × 2^122)
  • One trillion (1012) UUIDs: p ≈ 1024 ÷ 1.06 × 1037 ≈ 9 × 10−14.
  • A 50% chance needs about 2.7 × 1018 UUIDs. At one billion per second, that takes about 86 years.

This only holds when the random bits are truly random. This tool uses the browser's secure generator (crypto.randomUUID or crypto.getRandomValues), not Math.random. For v7, only UUIDs made in the same millisecond can collide, and 74 random bits make that very unlikely too.

Why v7 is better for database keys

Most databases store primary keys in a B-tree index. Random v4 keys land at random places in that index. Each insert can touch a different page, so pages split, the index grows fragmented, and less of it stays in memory. With large tables, inserts slow down.

v7 keys increase over time, so new rows go to the end of the index, as with an auto-increment number. You keep the benefits of UUIDs (no central counter, IDs can be made on the client) and get sequential writes. A v7 key also tells you roughly when the row was created.

One caution: that timestamp is visible to anyone who sees the ID. If creation time is sensitive, use v4.

Tips

  • Store UUIDs as 16 bytes (PostgreSQL uuid, MySQL BINARY(16)) rather than 36-character text.
  • Compare in lower case. RFC 9562 says to output lower case and to accept either case on input.
  • A UUID is not a secret. For password-reset links or API keys, use a dedicated random token, for example from the password generator.

Frequently asked questions

What is the difference between a UUID and a GUID?
None in practice. GUID is Microsoft's name for the same 128-bit identifier. Windows tools often show GUIDs in upper case and inside braces, which you can match with the options here.
Should I use UUID v4 or v7?
Use v7 for database primary keys and anything you want to sort by creation time. Use v4 when the ID must not reveal when it was created.
Are these UUIDs really unique?
In practice, yes. A v4 UUID has 122 random bits from your browser's secure random generator. You would need about 2.7 × 1018 of them for a 50% chance of a single duplicate.
Can I get the creation time from a UUID?
Only from time-based versions. Paste a v1, v6 or v7 UUID into the inspector to see its timestamp. v4 UUIDs contain no time.
Are generated UUIDs stored or sent anywhere?
No. They are created in your browser and are not uploaded or saved. Only your options, such as version and count, are remembered on this device.

Last updated . How we check our tools.