utilyfe

UUID Generator

Make random or time-ordered UUIDs in bulk, and inspect one to see its version and age.

Runs entirely in your browser. Nothing you enter is uploaded or stored.

Inspect a UUID

Paste one to check it's valid and see its version, and, for v1 and v7, when it was made.

How to use the UUID Generator

  1. 1Pick a version: v4 for a plain random id, v7 when the ids will become database keys.
  2. 2Choose how many you need, then set uppercase, hyphens or braces to match the system you're pasting into.
  3. 3Press Copy to take the list, or Generate again for a fresh batch.
  4. 4Paste any UUID into the inspect box to see its version, its variant and, for v1 and v7, when it was created.

v4 or v7?

Version What it is Use it for
v4 122 random bits Anything where the id just needs to be unique
v7 48-bit timestamp, then randomness Database keys, event ids, anything you’ll sort or page through
nil All zeros A placeholder meaning “no id”

v4 is the one most people mean by “a UUID”. v7 is newer, standardised in 2024, and is the better default for rows in a database.

Why v7 is kinder to a database

A v4 UUID is random, so consecutive inserts land in unrelated places in the index. The database keeps splitting pages and jumping around the disk, and the index grows larger than it needs to be. It works, but it gets slower as the table grows.

A v7 starts with the time in milliseconds, so ids made close together sort close together. Inserts append to the end of the index, and “give me the newest 50 rows” becomes a range scan rather than a sort. You also get the creation time for free, without a separate column.

The trade-off is that the time is visible to anyone who sees the id.

Are they really unique?

A v4 UUID has 122 random bits. That’s a large enough space that collisions are a theoretical concern rather than a practical one: you’d need to generate about 2.7 quintillion ids for a 50% chance that any two matched, roughly 85 years of producing a billion every second.

What does go wrong in practice is a weak source of randomness: a library using Math.random, or a system where several machines start from the same seed. This page uses the browser’s cryptographic generator, which is designed for keys and tokens.

The formats you’ll meet

The same id turns up written in several ways, and they’re all the same 16 bytes:

  • 0189d6a1-2b3c-4d5e-8f90-1234567890ab: the standard hyphenated form
  • 0189d6a12b3c4d5e8f901234567890ab: compact, common in URLs and some database columns
  • {0189D6A1-2B3C-4D5E-8F90-1234567890AB}: braces and uppercase, from Microsoft tools
  • urn:uuid:0189d6a1-2b3c-4d5e-8f90-1234567890ab: the formal URN form

The generator writes whichever you tick, and the inspect box accepts all of them.

Reading a UUID

Two characters tell you most of what there is to know. The first character of the third group is the version, and the first character of the fourth group is the variant, which is 8, 9, a or b for anything modern.

That’s how the inspect box knows what you pasted, and how it can pull the timestamp back out of a v1 or a v7.

Questions

Are these generated on a server?
No. They come from your browser's own cryptographic random number generator, the same one used for keys and tokens. Nothing is uploaded, and the page keeps working offline.
Could a UUID I generate here collide with someone else's?
In practice, no. A v4 UUID has 122 random bits. You would need to generate roughly 2.7 quintillion of them before there was a 50% chance of a single repeat: around 85 years of generating a billion per second. The risk that matters is a weak random source, which is why this page uses the cryptographic one rather than Math.random.
Is a UUID a good password or API token?
A v4 UUID is unguessable enough to act as a secret in a pinch, since it comes from a cryptographic source. But v1 and v7 are not: they contain a readable timestamp, and v1 historically contained the machine's network address. For anything that guards access, generate a dedicated random token instead.
What is the nil UUID for?
All zeros is the standard way to say “no id here”. It's useful as a placeholder or a default value in a database column, and you'll see it in logs where an id was expected but never set.
Does v7 leak information?
Yes, deliberately. The first 48 bits are the creation time in milliseconds, which is exactly what makes it sortable. Anyone holding the id can read when the record was made, so don't use v7 where that timing is sensitive.