Cadmeo

UUID Generator

Up to 500.

UUID

Paste one to confirm its format and version.

The UUID generator produces version 4 random identifiers and version 7 time-ordered ones, up to 500 at a time, and checks whether a UUID you already have is well formed. Version 7 is the one to reach for when the identifier becomes a database key.

How it works

A UUID is 128 bits written as 32 hexadecimal digits in a 8-4-4-4-12 pattern. Six of those bits are fixed: four mark the version and two mark the variant, which is why every v4 UUID has a 4 at position 15 and one of 8, 9, a or b at position 20.

  • Version 4 is 122 random bits from the browser cryptographic generator. There is no timestamp, no counter and no machine identifier in it.
  • Version 7 puts a 48-bit millisecond timestamp at the front, followed by 74 random bits. Sorting v7 UUIDs as strings sorts them by creation time.
  • That ordering is the whole point of v7: random v4 keys scatter inserts across a B-tree index, which fragments it and slows writes. Sequential keys append.
  • The checker verifies the layout, the version digit and the variant bits, the three things a malformed UUID usually gets wrong.

On collisions: with 122 random bits you would need to generate about a billion UUIDs per second for 85 years to reach a 50% chance of one duplicate. Treat v4 collisions as impossible rather than unlikely.

Examples

A version 4 UUID

Version

v4

Result

7c9e6679-7425-40de-944b-e07fc1f90ae7

The 4 after the second hyphen is the version, and the 9 after the third is the variant. Everything else is random.

Version 7 sorts by time

Version

v7, generated in sequence

Result

Each UUID sorts after the one before it

The leading 48 bits are the millisecond timestamp, so lexicographic order matches creation order.

Checking one

UUID

7c9e6679-7425-90de-944b-e07fc1f90ae7

Result

Rejected: 9 is not a valid version

Versions run 1 to 8. A 9 in that position means the identifier was not produced by any UUID algorithm.

Frequently asked questions

Should I use v4 or v7?

v7 if the UUID will be a database primary key, because its time ordering keeps index inserts sequential rather than scattering them. v4 for anything where an identifier should reveal nothing, a v7 UUID leaks its creation time to anyone who reads it.

Can two UUIDs ever be the same?

In practice, no. v4 carries 122 random bits, which is about 5.3 × 10^36 possibilities. Generating a billion per second. You would need roughly 85 years to reach a 50% chance of a single collision. It is safe to treat them as unique without checking.

What is the difference between a UUID and a GUID?

Nothing meaningful. GUID is Microsoft's name for the same 128-bit identifier, and the formats are interchangeable. Microsoft tooling often wraps them in braces and uses uppercase, which is why both options are offered here.

Are these generated on a server?

No. They come from your browser's crypto.getRandomValues, which is seeded from operating system entropy, the same source used for cryptographic keys. No request is made, so no generated UUID is ever seen by anyone else.

Is a UUID safe to use as a secret?

A v4 UUID has 122 bits of entropy, which is plenty. The problem is that UUIDs are treated as non-secret by convention. They end up in URLs, logs and analytics. Use a token generator for anything meant to stay private.