A UUID like 3fa85f64-5717-4562-b3fc-2c963f66afa6 looks like arbitrary noise, but it's a precisely defined format, not just a random string.
What the format actually encodes
A UUID is a 128-bit number, conventionally written as 32 hexadecimal characters split into five groups (8-4-4-4-12) separated by hyphens. Our UUID Generator produces version 4 UUIDs — the random variant, and by far the most common kind used in software. Of the 128 bits, 122 are actually random; the remaining 6 are fixed to specific values that mark the UUID as "version 4" and set its variant bits, which is how software can recognize the format itself, not the identity it holds.
Why collisions are, practically, not a real risk
122 random bits is a search space of about 5.3 × 1036 possible values. The commonly cited comparison: you'd need to generate roughly a billion UUIDs every second for about 85 years before the odds of ever seeing a single duplicate crossed 50% — and that's a coincidental collision from pure randomness, not anything an attacker could meaningfully target. For essentially every real application, "could two UUIDs collide" is not a practical engineering concern.
When a UUID is the right choice over an auto-increment ID
- Merging data from multiple sources — two databases can each generate IDs independently with no coordination and never collide, unlike auto-increment integers which will.
- Not wanting to expose sequential IDs — an auto-increment order or invoice ID leaks how many records exist and lets anyone guess neighboring ones just by changing a number in the URL; a UUID reveals nothing.
- Generating an ID before it's saved anywhere — a client or a queued job can create a valid, permanent ID upfront, with no round trip to a database to ask "what's the next number."
The trade-off: a UUID is 16 bytes versus 4 or 8 for a typical integer ID, and because it's non-sequential, it can hurt insert performance on some database index structures at very large scale — real considerations for a high-throughput system, but rarely the deciding factor for most applications.
Using the tool
Generate up to 20 version-4 UUIDs at once, ready to paste into code, a database seed, or test fixtures. Try it here: UUID Generator.