numvana

Birthday Paradox Calculator

Find the probability that at least two people in a group share the same birthday — or generalize to any number of equally likely categories.

Probability at least two share a category
50.7297%
Probability everyone is different
49.2703%

How it works

The 'birthday paradox' is the surprising fact that it only takes 23 people for there to be better-than-even odds that two of them share a birthday, even though there are 365 days to spread across. It's easiest to compute the complement first: the probability that everyone lands in a different category is (1) × (1 − 1/d) × (1 − 2/d) × ... × (1 − (n−1)/d), for a group of n people and d equally likely categories — the first person's category is free, and each person after that must avoid every category already claimed. The probability of at least one shared category is just 1 minus that product.

That product is computed in log-space (summing log(1 − i/d) terms and exponentiating at the end) so it stays numerically accurate for a large group instead of multiplying many factors that are each individually close to 1.

The 'number of possible categories' field defaults to 365 for the classic birthday version, but the underlying math applies to any set of equally likely categories — the same calculation answers 'what's the chance two people in a group share a favorite of N options' or 'how many random items until two probably collide into the same one of N buckets.' Once the group size exceeds the category count, a shared category is guaranteed outright by the pigeonhole principle, reported directly rather than computed from the product.

FAQ

Why is 50% reached with only 23 people, when there are 365 days?

Because the question isn't 'does someone share my birthday' (which would need a much bigger group) — it's 'do any two people in the room share a birthday with each other.' With 23 people there are 23×22/2 = 253 distinct pairs, and each pair has a small but real chance of matching; summed across that many pairs, the odds cross 50% much sooner than intuition suggests.

What happens if the group is bigger than the number of categories?

A shared category becomes mathematically certain — with 366 people and only 365 possible birthdays, at least two people must share one no matter how they're assigned, by the pigeonhole principle. This calculator reports that case as an exact 100%, not an approximation.

Related calculators