UUID Generator & Validator

Generate random UUIDs (v4) or time-ordered UUIDs (v7) for database keys, then copy or download them. Paste a UUID below to see its version and timestamp.

Version
Format


Inspect a UUID

The version, variant and creation time (v1, v6, v7) will appear here.

How to use it

  1. Choose Version 4 for ordinary random IDs, or Version 7 for database keys that sort by creation time.
  2. Enter how many you need (1 to 1000), then pick the format: uppercase, no hyphens, or wrapped in braces like a Windows GUID.
  3. Press Copy or Download .txt. Press Generate new to replace them all.
  4. To check a UUID, paste it into Inspect a UUID. Its version, variant and creation time (for v1, v6 and v7) appear right away.

UUID versions compared

A UUID (Universally Unique Identifier) is a 128-bit number written as 32 hexadecimal digits in five groups, for example 017f22e2-79b0-7cc3-98c4-dc0c0c07398f. The first digit of the third group (here 7) is the version, and the top bits of the fourth group are the variant. The current standard is RFC 9562 (May 2024), which replaced RFC 4122 and added versions 6, 7 and 8.

VersionContentsSorts by timeNotes
1Time (100 ns steps since 15 Oct 1582) + nodeNoNode is usually the MAC address
3MD5 of namespace + nameNoSame name, same UUID
4122 random bitsNoThe most common
5SHA-1 of namespace + nameNoPreferred over v3
6v1 time, most significant part firstYesFor systems already using v1
748-bit Unix milliseconds + 74 random bitsYesRFC 9562's choice for new data
8Free-form vendor layoutDependsFor special needs

Version 2 (DCE Security) is reserved and rarely used. There are also two special values: the Nil UUID (all bits 0) and the Max UUID (all bits 1).

What are the odds of two v4 UUIDs colliding?

A v4 UUID has 122 random bits; the other 6 hold the version and variant. That gives 2122, about 5.3 × 1036, possible values. By the birthday paradox, the chance of any two being equal among n UUIDs is roughly n² ÷ (2 × 2122). For one billion UUIDs that is (109)² ÷ (1.06 × 1037) ≈ 9.4 × 10-20. A 50% chance is only reached at about 2.7 × 1018 UUIDs, which means generating one billion per second for 86 years.

That arithmetic only holds if the random source is good. This tool uses only crypto.getRandomValues, the browser's cryptographic random generator. UUIDs built with Math.random do not meet that bar.

Why v7 makes a good database key

B-tree indexes, used by MySQL, PostgreSQL and most other databases, keep keys in sorted order. Random v4 UUIDs land at random positions in the index, so index pages split often and caching works poorly. RFC 9562 cites this index locality problem as one of the reasons for the new versions. A v7 UUID starts with the time in milliseconds, so new rows always go at the end of the index, as with an auto-increment number, yet the application can create the key without asking the database.

Here the 12 bits after the timestamp are a counter (method 1 in RFC 9562 section 6.2). It goes up by one for each UUID within the same millisecond, so 1000 UUIDs generated at once still come out in order. The trade-off is that a v7 UUID reveals when it was created: anyone can read the time with the inspector above. If creation time must stay private, use v4.

Questions

Are these UUIDs really unique?
There is no absolute guarantee, but the odds of a clash are tiny: about 1 in 1019 for a billion v4 UUIDs. They are created in your browser with a cryptographic random generator, not taken from a list on a server, and we do not store them.
What is the difference between a UUID and a GUID?
GUID is Microsoft's name for the same thing: a 128-bit number in the same format. Windows tools and Visual Studio usually write it in uppercase with braces, such as {919108F7-52D1-4320-9BAC-F847DB4148A8}. Tick Uppercase and Braces to get that format.
Should I use v4 or v7?
For database primary keys, use v7: it sorts by time, so the index stays compact. For IDs that must not reveal when they were created, such as IDs shown in public URLs, use v4.
Can a UUID be used as a secret token?
Better not. Section 8 of RFC 9562 says implementations should not assume UUIDs are hard to guess and must not use them as identifiers whose mere possession grants access. For login tokens or password-reset links, use a dedicated random token of at least 128 bits.
Can I read the creation time from a UUID?
Yes for versions 1, 6 and 7. Paste the UUID into Inspect a UUID. Versions 1 and 6 store time in 100-nanosecond steps since 15 October 1582, version 7 in milliseconds since 1 January 1970. Versions 3, 4 and 5 contain no time.
What does the variant in the result mean?
The variant says how to read the remaining bits. Almost every modern UUID has the RFC 9562 variant (bits 10). The others come from older systems: NCS (bit 0) and old Microsoft COM GUIDs (bits 110). UUIDs with a non-RFC variant have no meaningful version number.