Generate a UUID v4

Press Generate to mint a version 4 UUID from crypto.randomUUID(): 122 random bits in a 128-bit, 36-character frame. You would need about 2.3×10¹⁸ IDs for a 50% chance of one collision. Use v4 when the creation time must stay private: request IDs, idempotency keys, public tokens. IDs are generated on this device.

Press Generate to create a UUID.

Waiting for Generate122 random bitsGenerated on this device

Runs in this tab · nothing is uploaded · Verify in 10 seconds →

What this does

A version 4 UUID carries exactly 122 random bits (2¹²² ≈ 5.3 × 10³⁶ possible values) inside a 128-bit, 36-character frame; the remaining 6 bits are the version nibble (the “4” starting the third group) and variant bits (8, 9, a or b starting the fourth). Press Generate below; each ID comes from crypto.randomUUID(), the browser's cryptographically secure generator.

The birthday bound puts a number on “unique enough”: you would need about 2⁶¹ ≈ 2.3 × 10¹⁸ v4 UUIDs (a billion per second for 73 years) before reaching a 50% chance of a single collision anywhere in the set. Per RFC 4122/9562, that is why v4 IDs are minted without any coordination between machines.

When it goes wrong

If you need IDs that sort by creation time, v4 is structurally the wrong version, no amount of generation luck makes random IDs ordered. That job belongs to UUID v7 (48-bit millisecond timestamp prefix), which this generator also produces (switch the version toggle above), and the v4 vs v7 guide explains when each fits. If two “identical” UUIDs ever appear in your system, suspect a cloned VM or copy-pasted row before suspecting the randomness.

When to use this

Use v4 for identifiers that must reveal nothing: request IDs, idempotency keys, public tokens, file names, and any key where creation time is nobody's business.

This page is a focused view of theUUID Generator (v4 & v7): GUID Generator, which has the full set of options.

Frequently asked questions

Can two v4 UUIDs collide?

In theory yes, in practice no: with 122 random bits you would need roughly 2.3×10¹⁸ UUIDs for a 50% chance of one collision. Treat them as unique.

Are these UUIDs generated securely?

Yes, crypto.randomUUID() uses the browser's CSPRNG, per RFC 4122/9562 requirements for version 4. They are generated on your device and never transmitted.

Why do all the UUIDs have a 4 in the third group?

That nibble encodes the version. A v4 UUID always reads 4 there, and the first character of the fourth group is 8, 9, a or b (the variant bits).