← Back to home

What Is a UUID v4 and Why Is It Everywhere?

Published on Nov 10, 2026 · 4 min read

Look inside any modern app and you'll find strings like 3f8a2c4e-9b1d-4e7f-a3c2-8d5e6f1a2b3c attached to users, orders, sessions, and files. That's a UUID — and the "v4" flavor is the one you see most. Here's what it actually is, and when you should (and shouldn't) use one.

Anatomy of a UUID

A UUID is a 128-bit number displayed as 36 characters: five groups of hexadecimal digits separated by dashes, in an 8-4-4-4-12 pattern. In a version 4 UUID, almost everything is randomness:

The point of all that randomness: anyone, anywhere, can generate an identifier without asking a central authority, and be effectively certain it's never been used before.

How Safe Is "Effectively Certain"?

The math is absurd. To reach a 50% chance of a single collision between two v4 UUIDs, you'd need to generate about 2.7 quintillion of them — roughly a billion per second for 85 years. For any real application, collisions are a rounding error you can ignore.

UUID vs Auto-Increment IDs

Database auto-increment (1, 2, 3...) is simple and sortable. So why did the industry fall in love with UUIDs?

The downsides are real too: UUIDs are bigger (128 bits vs 32), don't sort by creation time, and make URLs ugly. Many teams use both — auto-increment internally, UUID exposed publicly.

Where You'll Actually Use Them

Other UUID Versions, Briefly

Version 4 isn't the only kind. v1 embeds a timestamp and MAC address (sortable, but leaks the generating machine's identity). v7 is a newer timestamp-first design that sorts like auto-increment while staying unique — databases love it. But v4 remains the universal default: every language generates it natively, every database accepts it, and pure randomness leaks nothing.

Generating UUIDs in Bulk

The UUID generator creates up to 1,000 v4 UUIDs in one click, entirely in your browser — nothing is logged or transmitted. Two format options cover the common variants:

Both forms encode the same 128-bit value; pick whichever your stack expects, then hit Copy All.

One honest caveat: this generator uses your browser's standard random source, which is perfect for identifiers, keys, and test data. For security tokens and secrets, use a CSPRNG-backed tool like our password generator instead.

Related Guides