🎯 UUID Collision Probability Calculator
How likely is it that two random version-4 UUIDs ever collide? This works out the odds using the same "birthday paradox" math that explains why shared birthdays in a room come up sooner than intuition suggests.
1. How many UUIDs?
1e12 both work.
2. Result
| UUIDs generated (n) | — |
|---|---|
| Total v4 UUID space | 2¹²² ≈ 5.3 × 10³⁶ |
| Approx. collision probability | — |
| Formula used | 1 − e^(−n² / (2 × 2¹²²)) |
Why this math?
A version-4 UUID has 122 bits chosen at random (the other 6 bits are fixed to mark it as version 4, variant 1), giving 2¹²² ≈ 5.3 × 10³⁶ possible values. The "birthday paradox" says that when you draw n items uniformly at random from a space of size N, the probability that at least two of them match is approximately 1 − e^(−n² / (2N)) once n is reasonably large relative to √N — the same reasoning that makes shared birthdays surprisingly likely in a room of just 23 people, even though there are 365 possible birthdays.
Because N = 2¹²² is astronomically large, the probability stays negligible even at huge scale: generating a billion UUIDs a second for 100 years (about 3.2 × 10¹⁸ UUIDs) would still put the collision probability at roughly 1 in a billion. In practice, v4 UUID collisions are not a realistic operational risk — implementation bugs (bad randomness sources, reused seeds) are a far more likely cause of a duplicate than the math above.