Birthday Paradox & Hash Collision Probability Calculator
Find out how soon random identifiers or hashes will start to collide.
Use the tool
Why this tool exists
Enter the number of items and the size of the space (a number such as 365 or 2^64). For small spaces the exact product is used; otherwise the standard approximation 1 - e^(-n(n-1)/(2N)). The page also gives the number of items for a 50%, 1% and one-in-a-million collision chance.
The birthday bound means a b-bit random value starts colliding after roughly 2^(b/2) items, which is why short hash prefixes and 64-bit IDs need care. Results assume uniformly random values.
No data is sent anywhere: the work happens in your browser, so you can use it offline once the page has loaded.
How to use it
- Enter n and N (or 2^bits).
- Read the collision probability.
- Check the item counts for common risk levels.
- Use more bits if the risk is too high.
Frequently asked questions
Why do 23 people give 50%?
Because the number of pairs grows with the square of the group size.
How many bits for 1 billion IDs?
To keep collision chance near 1 in a million you need about 70 bits.
Does it apply to hash functions?
Yes for random outputs. It describes accidental collisions, not attacks.
Is my data sent anywhere?
No. Everything is processed in your browser, and the page makes no network requests with your input.