Collision Calculator
Calculate the probability of getting duplicate IDs based on how many you plan to generate. Powered by the birthday paradox formula.
Configuration
Secure, compact, URL-safe (Recommended)
Understanding ID Collisions
A collision occurs when two independently generated IDs happen to be identical. While rare, understanding collision probability helps you choose the right ID format for your scale.
The Birthday Paradox
The "birthday paradox" is a famous probability puzzle: in a room of just 23 people, there's a 50% chance that two share a birthday. This seems counterintuitive because there are 365 possible birthdays.
The same principle applies to unique IDs. Collisions become probable much sooner than you might expect — roughly at the square root of the total possible ID space.
ID Type Comparison
| Type | Random Bits | 50% Threshold |
|---|---|---|
| CUID2 (24 chars) | ~120 bits | ~1.3 × 10¹⁸ IDs |
| UUID v4 | 122 bits | ~2.7 × 10¹⁸ IDs |
| CUID v1 | ~48 random bits | ~17 million IDs |
| Auto-increment (32-bit) | N/A | 4.3 billion max |
Note: CUID v1 also uses timestamp and fingerprint for uniqueness, so actual collision risk in practice is lower than pure random would suggest.