UUID v4 Generator

Random RFC 4122 identifiers, one at a time or five at once.

How UUID v4 works

A version 4 UUID is 128 bits, of which 122 are random; the remaining six identify the version and variant. That fixed structure is why every v4 value has a 4 at the start of its third group and one of 8, 9, a, or bstarting the fourth. Everything else is noise from a secure random source.

The appeal is that no coordination is needed. Two services on opposite sides of a network can each mint identifiers with no shared counter and no registry, and still not collide. That makes v4 the default for distributed systems, message IDs, and client-generated records.

The cost is ordering. Because the bits are random, consecutive UUIDs land in unrelated places in an index, which fragments B-tree inserts. If you are choosing a primary key for a large table, look at UUID v7, which puts a timestamp in front and keeps inserts sequential.

Frequently asked questions

What is a UUID v4?

A 128-bit identifier whose bits are random apart from a version marker and two variant bits. It is written as 32 hexadecimal digits in a 8-4-4-4-12 pattern, and needs no central authority to issue it — any machine can mint one independently.

Can two UUID v4 values collide?

In principle yes, in practice no. With 122 random bits you would need to generate on the order of a billion UUIDs per second for about 85 years before a single collision becomes likely. For application identifiers, treat them as unique.

What is the difference between UUID v4 and v7?

v4 is fully random, so values sort arbitrarily. v7 embeds a timestamp prefix, which makes identifiers sort chronologically and behave far better as database primary keys. This tool generates v4, the variant supported natively by browsers.

Are these UUIDs suitable as security tokens?

They come from crypto.randomUUID, which is cryptographically secure, so the randomness is sound. Even so, prefer a purpose-built token for session or reset secrets — UUIDs are often logged and exposed in URLs where a secret should not be.

Is anything generated on a server?

No. crypto.randomUUID runs in your browser and the values are never transmitted. Reload the page and you get entirely fresh identifiers.