Part of the Technology & IT suite · 45 calculators

Hash Collision Probability Calculator

The probability that two of N random hashes or identifiers collide, from the birthday paradox — and how many items you can generate before the risk reaches a level you choose.

With H possible values, the chance that N items include at least one collision is about 1 − e^(−N² ÷ 2H): it grows with the square of N, so a collision becomes likely around √H items, not H.

Results update as you type
Results
Probability of at least one collision
2.71e-8
Possible values
Items for a 50% chance
Items at your acceptable risk
Reads as
Reviewed September 2026. Computing arithmetic: bytes, bits, seconds and probabilities do not change by country. Australian broadband speeds are quoted in megabits per second (Mbps).
No account required · Google Analytics off unless allowedCalculator arithmetic runs in your browserResults update as you type
All calculations run 100% in your browser. The calculator code does not submit your figures to GlobalCalc to obtain a result.
About hash collision probability

How the hash collision probability calculator works

With H possible values, the chance that N items include at least one collision is about 1 − e^(−N² ÷ 2H): it grows with the square of N, so a collision becomes likely around √H items, not H. A 32-bit hash is 50% likely to collide after 77,000 items; a 64-bit one after 5 billion; a 128-bit UUID needs 2.6 × 10¹⁹. Use the target-risk row to size an identifier.

Formula: P ≈ 1 − exp(−N(N − 1) ÷ (2 × 2ᵇ)); N for risk p ≈ √(2 × 2ᵇ × ln(1 ÷ (1 − p)))

Worked examples

InputsProbability of at least one collisionNote
A million 64-bit hashes2.71e-82.7 × 10⁻⁸ — negligible
100,000 32-bit hashes68.781%68.8% — expected
A billion random UUIDs9.40e-209.4 × 10⁻²⁰

Frequently asked questions

Why does a collision come at the square root of the space?

Because every pair of items is a chance to collide, and there are N²/2 pairs. That is the birthday paradox: 23 people give a 50% chance of a shared birthday among 365 days.

Is a UUID safe?

A random v4 UUID has 122 random bits: you would need about 2.7 × 10¹⁸ of them for a 50% chance of a duplicate, and a billion a second for 85 years to get there. The risk in practice is a bad random-number generator, not the size.

What about deliberate collisions?

This calculator is about accidental collisions among random values. MD5 and SHA-1 are broken against attackers who craft collisions on purpose, which is a different problem — use SHA-256 or better for anything security-related.

How small a hash can I use for a lookup table?

Pick the risk you can tolerate and read the sizing row: for a million items and a 0.0001% risk you need about 60 bits, so a 64-bit hash is fine and a 32-bit one is not.

Where these figures come from

Last checked: September 2026. Units follow the SI decimal convention (IEC 80000-13 defines the binary alternatives); network and security figures cite the defining standard.