ToolJoltTools

Birthday Problem Calculator

Probability that two people in a group share a birthday — the classic counter-intuitive probability result.

P(at least one shared) (%)
P(all different) (%)

The famous result: just 23 people give a >50% chance of a shared birthday, and 70 people make it 99.9%. The intuition fails because there are C(23,2)=253 PAIRS, not 23. Collisions become likely at roughly √d items — the exact principle behind hash collisions and the 'birthday attack' in cryptography.

Formula

P(shared) = 1 - ∏(d-i)/d for i=0..n-1 — collisions become likely at ~√d people, far fewer than intuition suggests
References: von Mises (1939); standard probability; Birthday attack — cryptographic hash collision analysis

About Birthday Problem Calculator

The birthday problem is probability's most famous counter-intuitive result: in a room of just 23 people, there's a better-than-even chance two share a birthday, and 70 people make it virtually certain. This calculator computes the probability for any group size and any 'year' length — which is why it's also a cryptography tool, since the same math governs hash collisions and the 'birthday attack'. The intuition fails because the number of PAIRS grows quadratically (23 people make 253 pairs), and collisions become likely at roughly the square root of the space size.

How to use Birthday Problem Calculator

  1. 1Enter your values into Birthday Problem Calculator — sensible, domain-typical defaults are pre-filled so you see a real result immediately.
  2. 2The result recomputes live using the formula shown on the page; there is no button to press.
  3. 3Adjust any input to compare scenarios, then read the worked example to see the substituted numbers.

Why use Birthday Problem Calculator?

  • Computes Birthday Problem instantly in your browser — no sign-up, no upload, no server round-trip.
  • 100% free and unlimited, with the exact formula shown: P(shared) = 1 - ∏(d-i)/d for i=0..n-1 — collisions become likely at ~√d people, far fewer than intuition suggests.
  • Runs entirely client-side, so every value you enter stays private on your device.
  • Live recompute as you type, with a worked example and authoritative references for trust.

Frequently asked questions

Why does it only take 23 people for a 50% chance?+

Because what matters is the number of pairs, not people. 23 people form C(23,2) = 253 possible pairs, and each pair has a 1/365 chance of matching. With 253 chances, a match becomes more likely than not. People wrongly imagine comparing themselves to 22 others (their own birthday), missing the 253 comparisons happening across the whole group.

What's the connection to hash collisions and cryptography?+

Identical math. The chance two items hash to the same value in a space of d hashes mirrors the birthday problem with d 'days'. Collisions become likely at ~√d items, not d — so a 64-bit hash is vulnerable to a 'birthday attack' after ~2³² (4 billion) items, not 2⁶⁴. This halving of effective security is why hash output sizes are chosen with the birthday bound in mind.

How does the probability scale with the space size?+

The 50% point sits at roughly 1.18√d. For 365 days that's ~23; for a million-item hash space it's ~1,177; for 2⁶⁴ it's ~5 billion. The square-root law means doubling the bits of a hash quadruples the collision resistance — the key design principle for choosing hash and nonce sizes in security systems.

Does this assume birthdays are evenly distributed?+

Yes — the standard formula assumes a uniform distribution across days. Real birthdays cluster slightly (seasonal effects), which only INCREASES the collision probability, so 23 people is if anything a conservative estimate. For the cryptographic version, a good hash function distributes outputs uniformly by design, making the uniform assumption appropriate there.

Related tools

Related Statistics tools

Sponsored