ID Collision Probability Calculator
Calculate the chance that randomly generated IDs collide, from their bits or their alphabet and length, and how many IDs reach a 1% or 50% chance.
Free · No sign-up · Your inputs stay in your browser
Input
How likely is an ID collision?
Output
Chance of at least one collision: 5.88e-21
| Entropy | 126.0 bits |
|---|---|
| Possible values | 2^126.0 |
| IDs for a 1% chance | 1.31e+18 |
| IDs for a 50% chance | 1.09e+19 |
The birthday bound: with N possible values, n random IDs collide with probability about 1 − e^(−n²/2N), so collisions arrive around √N, far sooner than N. A UUIDv4's 122 random bits need about 2.7 × 10^18 IDs for a 50% chance. Short codes are where it bites: a 6-digit code collides with 50% likelihood after only about 1,200 draws. For UUIDv7, the random bits only have to be unique within one millisecond.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
The birthday bound
Collisions arrive at around the square root of the number of possible values, much sooner than intuition suggests. A UUIDv4's 122 random bits need about 2.7 × 10^18 ids for an even chance, which is why they are treated as unique. A 6-digit code reaches 50% after about 1,200 draws, which is why short codes need a uniqueness check.
Time-ordered ids
UUIDv7 and ULID use part of their bits for a timestamp, so only ids generated in the same millisecond can collide, and the random bits only need to be unique within that window. RFC 9562 describes the layouts.