🧮
🧮 Math & statistics

Birthday Paradox Calculator

Results update as you type.

Your numbers

Understanding the birthday paradox calculator — concept and principle

A birthday paradox calculator finds the probability that, in a group of k people, at least two share the same birthday. The answer surprises most people: only 23 people are needed for a better-than-even chance. The same mathematics is used to estimate collision risk in hash functions, random ID generation and sampling with replacement.

Birthday paradox: many pairs among 23 people23 people form 253 pairs; the chance all birthdays differ is 0.4927, so a shared birthday has probability 0.5073.23 people make 253 pairs to compare23 people23 × 22 ÷ 2 = 253no match at all:365/365 × 364/365× … × 343/365= 0.49271 − 0.4927 = 50.73%at least two share a birthday
It is the 253 pairs, not the 23 people, that push the chance of a shared birthday past 50%.

How it is calculated

  1. Probability that all k birthdays differ: P(no match) = (d/d) × ((d − 1)/d) × ((d − 2)/d) × … × ((d − k + 1)/d), the product of (1 − i/d) for i = 0 to k − 1, where d is the number of days in the year (365 by default).
  2. P(at least two share) = 1 − P(no match), also shown as a percentage.

If k is larger than d, a match is certain (the pigeonhole principle), and the product becomes 0.

The principle

It is easier to count the opposite event. The first person can have any birthday; the second must avoid one day, the third must avoid two, and so on. Multiplying these shrinking chances gives the probability that everyone is different. The result feels paradoxical because people instinctively compare against their own birthday, but a match can happen between any pair. With 23 people there are 23 × 22 ÷ 2 = 253 pairs, and each pair has a 1/365 chance of matching. A handy approximation is P(match) ≈ 1 − e^(−k(k−1)/(2d)).

Worked example

  1. Inputs: k = 23 people, d = 365 days.
  2. P(no match) = 365/365 × 364/365 × … × 343/365 ≈ 0.49270.
  3. P(at least two share) = 1 − 0.49270 ≈ 0.5073, or 50.73%.
  4. Check with the approximation: 1 − e^(−253/365) ≈ 0.500, close to the exact value.
How P(at least two share) changes with People in the roomHow P changes with People in the room00.20.40.60.815.7511.517.22328.834.546Example: 0.5072972343People in the room
Each point is the calculator re-run with only “People in the room” changed; the gold point is the default example. Change the inputs above and this chart follows your numbers.
People in the roomP(at least two share)
5.750.0404624837
11.50.1670247888
17.20.3469114179
230.5072972343
28.80.6809685375
34.50.8143832389
460.9482528434

How to read the result

The probability rises fast: about 11.7% for 10 people, 70.6% for 30, 97.0% for 50 and 99.9% for 70. In contrast, the chance that someone in a group of 23 shares your own birthday is only about 6%. For computer systems, the same rule says that a hash with N possible values starts to see collisions after roughly √N items.

Common mistakes

Keep in mind: The model assumes birthdays are independent and spread evenly over 365 days, and ignores 29 February. Real births are slightly uneven across the year, which makes matches a little more likely, and twins in a group break independence.

Frequently asked questions

How many people are needed for a 99% chance?

57 people give about 99.0%.

Does including 29 February change the answer?

Only slightly. Set the days to 366 to see the effect; 23 people still give about 50%.

What is the birthday attack in cryptography?

It uses this same probability to find two inputs with the same hash much faster than trying to match one fixed hash.

Sources: Feller, W., An Introduction to Probability Theory and Its Applications, Vol. 1 (Wiley) · Ross, S. M., A First Course in Probability (Pearson)

Checked 8 Nov 2026. Standard formulas, computed in your browser with double-precision numbers.

🧮 All math & statistics tools →🌍 Calculators by country →