Birthday Paradox Calculator

Discover the surprising probability of shared birthdays in any group. Interactive, fast, and educational.

Classic birthday problem: With 23 people, the probability of a shared birthday exceeds 50%. With 70 people, it's over 99.9%.

Enter a value between 1 and 500. Decimals are rounded down.
Standard year = 365. Adjust for leap year (366) or other planets.
23 people (≈50%) 50 people (≈97%) 70 people (99.9%) 100 people (almost certain) 22 people (leap year)
Computing...

Understanding the Birthday Paradox

The birthday paradox refers to the counter‑intuitive fact that in a group of just 23 people, the probability of two sharing a birthday exceeds 50%. With 70 people, it's over 99.9%.

General formula (for d days):

P(match) = 1 - (d/d) × ((d-1)/d) × ... × ((d-n+1)/d)

where n ≤ d. If n > d, probability = 1 (by pigeonhole principle).

Mathematical Derivation

It's easier to compute the probability no two people share a birthday. For n people:

  • First person can have any birthday: d/d
  • Second person must avoid first's birthday: (d-1)/d
  • Third avoids both previous: (d-2)/d, and so on.

Thus P(no match) = ∏_{i=0}^{n-1} (d-i)/d. Then P(match) = 1 - that product.

Approximation for Large d

When d is large (like 365), the product can be approximated using the exponential function:

P(no match) ≈ e^{-n(n-1)/(2d)}

This approximation comes from the Taylor expansion ln(1-x) ≈ -x. For d=365, solving e^{-n²/(2d)} = 0.5 gives n ≈ √(2d ln2) ≈ √(2·365·0.693) ≈ 22.5, explaining why 23 is the threshold.

Key Numbers for 365 Days

People (n) P(match)
10 11.7%
23 50.7%
30 70.6%
40 89.1%
50 97.0%
57 99.0%
70 99.9%

Why Does It Feel Like a Paradox?

Most people mistakenly think about the chance that someone shares their own birthday. For 23 people, that probability is only about 6.1%. But the correct question considers any pair — and there are C(23,2) = 253 possible pairs, making a match much more likely.

Interesting Facts

  • In a room of 57 people, the probability of a shared birthday is 99% (often rounded to 99.0%).
  • The smallest n for which P(match) ≥ 1/2 is 23 for d=365, but for d=366 it's 23 as well (actually 23 gives 50.0% exactly).
  • The paradox is used in cryptography: a birthday attack on a hash function finds collisions faster than brute force, based on the same principle.

Real-World Applications

  • Cryptography: Finding hash collisions (birthday attack).
  • Coincidences: Explaining why seemingly rare events happen more often than expected.
  • Random number generation: Testing independence and uniformity.
  • Genetics: Probability of shared alleles in a population.

Calculator features: This tool uses exact arithmetic for probabilities, visualizes the probability curve, and lets you change the number of days to explore variations like leap years or other planets.

Frequently Asked Questions

Yes, the classic calculation assumes each day is equally likely and independence. In reality, birth rates vary slightly, which actually increases the probability of a match, so the classic result is a lower bound.

With 366 days, the probability for a given n decreases slightly. For example, with 23 people, probability drops from ~50.7% to ~50.0%. You can adjust the "days in a year" field above to see the effect.

It uses double‑precision floating point arithmetic. For n close to d, the product may become extremely small, but the result is accurate to at least 10 decimal places. For n > d, probability = 1 exactly.