Hash Collision Probability Calculator

Type n and bits. 10000 and 32 give 0.011642. 100000 and 32 give 1. 2000000 and 64 give 1.0842e-7. A birthday approx, not an attack.

This is p ≈ 1 − exp(−n(n−1)/(2×2^b)). Not an attack on a hash function. Password bits sit on password entropy.

Input data

Additional options (optional)

Results

Enter data and click Calculate.

How it works

Hash Collision Probability Calculator in this calculator is a birthday approximation. 10000 and 32 bits give 0.011642. 100000 and 32 give 1. 2000000 and 64 give 1.0842e-7. The calculator does not break MD5 and does not search a preimage.

Field hash-n is the item count. Field hash-b is digest bits. hash-target-p and hash-show-log10 are in the fill. The formula is 1 − exp(−n(n−1)/(2×2^b)). 10000 at 32 bits leaves 0.011642. A large n at 32 bits saturates the calculator to 1.

0.011642 is not an attack. 1 does not mean someone broke the hash. 1.0842e-7 at 64 bits is still an approximation. You type n and b. This is not a crypto lab.

Password entropy next door multiplies length by log2. Base64 sizes overhead. Here 10000 and 32 stay 0.011642, the birthday alone.

Type 10000 and 32, leave target 0.01 and log10 off, then Calculate. The result is 0.011642. 100000 at 32 gives 1.

10000 and 32 give 0.011642. 100000 and 32 give 1. 2000000 and 64 give 1.0842e-7. Another n at 32 changes 0.011642.

Formula

p ≈ 1 − exp(−n(n−1)/(2×2^b)). A birthday approximation, not a hash attack.

How to use

  1. Type n 10000 and bits 32.
  2. Leave target 0.01 and log10 off. Click Calculate. The result is 0.011642.
  3. 100000 and 32 give 1. 2000000 and 64 give 1.0842e-7.
  4. A birthday approximation, not an attack.
  5. The next card times password bits, not a collision.

10000 and 32 give 0.011642

Birthday p ≈ 1 − exp(−n(n−1)/(2×2^b)). 10000 and 32 give 0.011642. Not an attack.

Hash
Bits in hash-b. 2000000 and 64 give 1.0842e-7. Not an attack.
Collision
Two inputs, one digest. 100000 and 32 give 1. Not preimage.
Probability
The P result. 10000 and 32 leave 0.011642. Not a lab.

Examples

Example 1

  • n 10000
  • 32 bits

0.011642

What collision P at 10000 and 32 bits? 0.011642. Birthday, not an attack.

Example 2

  • n 100000
  • 32 bits

1

What P at 100000 and 32? 1.

Example 3

  • n 2000000
  • 64 bits

1.0842e-7

What P at 2000000 and 64? 1.0842e-7.

Related calculators

Common questions

What about 10000 and 32 bits?

0.011642. A birthday approximation, not an attack.

What about 100000 and 32?

1. A large n on a short digest saturates the calculator.

What about 2000000 and 64?

1.0842e-7. The same formula, a longer digest.

Is this an attack on MD5 or SHA?

No. The calculator does not search a function. Only P from n and b.

Why hash-target-p and log10?

They are in the fill. Extras keep P from n and b, with log10 off.

Is 0.011642 exact?

It is the 1 − exp(...) approximation. Not a pair enumeration.

How is this different from password entropy?

That card turns 12 and 95 into 78.8 bits. Here 10000 and 32 give 0.011642.

Does zero n count?

No. n and bits must be positive.

Is preimage on the page?

No. Only collision P from the birthday bound.

Knowledge sources

The calculator counts bits, bytes or throughput from your numbers. Below are SI and bit definitions (NIST).

Page updated in 2026.

The birthday paradox

A hash collision occurs when two different inputs produce the same hash value. Intuitive example: two different files sharing a CRC32 checksum — a tool may treat them as the same object even though the bytes differ.

In a group of just 23 people, there is already a better than 50% chance that two share a birthday — even though a year has 365 days. The same thing happens with hashes: the number of pairs to compare grows far faster than the number of items, so collisions appear much sooner than intuition suggests.

The approximation formula

The calculator uses the simplified birthday bound: P ≈ n² / (2 × 2^b), where n is the item count and 2^b is the number of possible hash values for a b-bit digest. The result is clamped at 100%. At n = 2^(b/2) the formula gives about 50% — a handy rule of thumb: "the halfway birthday point is the square root of the number of possible hashes."

Common hash sizes

AlgorithmLength (bits)Status
CRC3232Integrity check, not cryptographic.
MD5128Cryptographically broken — do not use for security.
SHA-1160Deprecated — practical collisions demonstrated since 2017.
SHA-256256Widely used standard, considered secure.

Security implications

  • Short hashes (32-64 bits) work fine for detecting transmission errors, but with millions of items collisions become practically guaranteed.
  • For identifiers, file deduplication, or caching, a collision is usually a minor annoyance (safe systems compare the underlying data too).
  • For digital signatures, certificates, and security integrity checks, a collision is a real threat (an attacker could substitute malicious data with the same digest) — there, only cryptographically resistant algorithms (SHA-256 and newer) are acceptable.

Limits of the approximation

The birthday formula is an upper-bound approximation — the exact probability is slightly lower, especially when n approaches 2^b. This tool computes the probability of any pair colliding, not resistance to a "preimage" attack (finding an input that produces a specific, chosen hash) — that is a different, much harder cryptographic problem.

Examples

  • 10,000 items, 32-bit hash → about 1.16% collision chance.
  • 65,536 items, 32-bit hash → exactly 50% collision chance (the birthday point).
  • 1,000,000 items, 64-bit hash → about 2.7 × 10⁻⁸ — essentially zero risk.