Hash Collision Birthday Paradox Calculator
Calculate hash collision probability from hash size in bits and number of stored values.
Find how many items trigger a 50% collision chance for any width.
The birthday paradox states that in a group of just 23 people, there is a 50% chance two share a birthday — far fewer than the 183 most people intuit. The same math applies to hash functions.
Why collisions matter. A collision occurs when two different inputs produce the same hash output. In hash tables, collisions degrade performance. In cryptography, they can completely break a scheme. The birthday paradox tells us how quickly collisions appear even with large hash spaces.
The probability of at least one collision:
P(collision) ≈ 1 - e^(-n(n-1) / (2 × 2^b))
For small n relative to 2^b, this simplifies to approximately n² / 2^(b+1).
where n is the number of values and b is the hash size in bits.
The 50% collision threshold:
n₅₀ ≈ 1.177 × 2^(b/2)
For a 32-bit hash: n₅₀ ≈ 77,000 values. For a 64-bit hash: n₅₀ ≈ 5.1 billion values. For a 128-bit hash: n₅₀ ≈ 2^64 values — essentially impossible in practice. For SHA-256 (256 bits): n₅₀ ≈ 2^128 values.
This is why MD5 (128-bit output) is broken for collision resistance — attackers can find collisions in roughly 2^64 operations, which is feasible. SHA-256 requires 2^128 operations for a collision, which is currently computationally impossible.
The practical lesson: a b-bit hash only provides b/2 bits of collision resistance, not b bits.
How we build and check this calculator
This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.
SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.