Article

UUID v4 vs. Other Versions: Why Almost Everyone Uses v4

Published 2026-09-14

UUIDs aren't all built the same way

A UUID is a 128-bit identifier, but the specification actually defines several different "versions" that generate those 128 bits in completely different ways. The version number is literally encoded into the UUID itself (it's one of the digits), so you can usually tell which kind of UUID you're looking at just by reading it.

The main versions, briefly

Why v4 became the default

For most applications — database primary keys, API request IDs, session tokens — you don't need sortability or determinism, you just need a unique identifier that can be generated independently on any machine without coordination or without leaking information about the machine that created it. Version 4 does exactly that with the simplest possible design, which is why it became the practical default across most programming languages and frameworks.

How random is "random enough"?

A version-4 UUID has 122 random bits (6 of the 128 bits are fixed to mark the version and variant). To put that in perspective, you could generate a billion UUIDs every second for about 85 years and still have less than a one-in-a-billion chance of ever generating a duplicate. Our UUID Generator produces version-4 UUIDs using your browser's secure random number generator, matching the same randomness quality used for encryption keys.

Ready to try it yourself?
Open the UUID Generator →