What Is a UUID? Version 4 Explained Simply
By the 325Tools Team · Updated 2026-06-17
Ever seen an ID like f47ac10b-58cc-4372-a567-0e02b2c3d479 and wondered what it is? That's a UUID — a Universally Unique Identifier. It's a 128-bit value written as 32 hexadecimal digits split into five groups by hyphens, for a canonical 36-character string. Its whole reason to exist is letting many systems mint IDs independently without ever coordinating, and without colliding.
How version 4 works
There are several UUID versions; version 4 is the one you'll meet most often. A v4 UUID is essentially random: 122 of its 128 bits are random, with the remaining bits fixed to mark it as "version 4, variant 1." Generate a few with the UUID Generator and you'll see the version digit is always 4 (the 13th hex character) and the variant digit is always one of 8, 9, a, or b.
Why collisions basically never happen
122 random bits is an astronomically large space — roughly 5.3 × 10^36 possible values. You would need to generate about a billion UUIDs per second for around 85 years just to reach a 50% chance of a single collision. In practice this means two independently generated v4 UUIDs will never clash, which is why services can create IDs offline, in parallel, on thousands of machines, and safely merge them later.
UUID vs auto-increment IDs
A traditional database auto-increment ID (1, 2, 3…) is compact and sortable, but it requires the database to hand out the next number, and it leaks information — anyone can see you have "user 5001" and guess your growth. UUIDs need no central counter, don't reveal counts or order, and can be generated on the client before a row ever hits the database. That independence is their main selling point.
When NOT to use a UUID
- As a clustered primary key in a large table. Random v4 UUIDs arrive in no particular order, so inserting them scatters writes across the index and causes page fragmentation, hurting insert performance and bloating storage on big tables. Databases like MySQL (InnoDB) are especially sensitive to this. If you need a database key, consider a sequential/ordered ID or a time-ordered UUID variant instead.
- When humans must read or type it. Thirty-six characters is error-prone to dictate over the phone. For short, human-friendly codes, a Random String Generator with a limited alphabet is friendlier.
- As a security token that must be unguessable and unforgeable. A v4 UUID is random but not a secret primitive; for signing or integrity, reach for a proper hash via the Hash Generator.
For distributed, coordination-free identifiers, though, the UUID Generator is exactly the right tool.