What Is the Birthday Paradox?
The birthday paradox (or birthday problem) asks a deceptively simple question: in a group of n people, what is the probability that at least two of them share the same birthday? The surprising answer is that you only need 23 people for the odds to exceed 50%, and just 70 people pushes the probability above 99.9%. It feels paradoxical because people instinctively compare against their own birthday, when in fact every pair in the group is a chance for a match.
How to Use This Calculator
Enter the group size n (the number of people) and read off the probability p(n) that at least one pair shares a birthday, shown as a percentage. The result table also shows the complementary probability that all birthdays are different. The calculator assumes a 365-day year with every day equally likely and ignores leap-year February 29 births.
The Formula Explained
It is easiest to compute the probability that no one shares a birthday and then subtract from 1. The first person can have any birthday (\(365/365\)). The second must avoid the first (\(364/365\)), the third must avoid the first two (\(363/365\)), and so on:
$$\bar{p}(n) = \frac{365}{365} \times \frac{364}{365} \times \cdots \times \frac{365 - n + 1}{365}$$
Then the probability of at least one shared birthday is $$p(n) = 1 - \bar{p}(n).$$ We compute the product iteratively to avoid factorial overflow.
Worked Example
For \(n = 23\), multiplying the 23 fractions gives \(\bar{p}(23) \approx 0.492703\), so $$p(23) = 1 - 0.492703 \approx 0.5073,$$ or about 50.73% — just over a coin flip. For the default \(n = 30\), \(\bar{p}(30) \approx 0.293684\), giving \(p(30) \approx\) 70.63%.
How to Compute the Probability by Hand
The calculator assumes 365 equally likely birthdays and ignores February 29. It is easiest to compute the chance that everyone has a different birthday and subtract that from 1.
- Choose n. This is the number of people in the group. If n > 365, the probability is 100% (pigeonhole principle).
- Write the product. The probability that all n birthdays are distinct is \(\prod_{k=0}^{n-1}\frac{365-k}{365}\). The first person can have any day, the second must avoid 1 day, the third must avoid 2 days, and so on.
- Multiply iteratively. Start with 1 and multiply by \(\frac{365}{365}, \frac{364}{365}, \frac{363}{365}, \dots\) up to \(\frac{365-(n-1)}{365}\). For n = 23 the last factor is \(\frac{343}{365}\).
- Subtract from 1. \(p(n) = 1 - \prod_{k=0}^{n-1}\frac{365-k}{365}\).
- Convert to percent. Multiply by 100.
Worked check for n = 23: the product of the 23 factors is about 0.4927, so
$$p(23) = 1 - 0.4927 \approx 0.5073$$
That is 50.73%.
Pair-count shortcut and approximation
A group of n people contains \(\binom{n}{2} = \frac{n(n-1)}{2}\) distinct pairs. Each pair matches with probability \(\frac{1}{365}\). Treating the pairs as roughly independent, and using \(1-x \approx e^{-x}\) for small x, gives:
$$p(n) \approx 1 - e^{-\frac{n(n-1)}{2\cdot 365}}$$
Quick check at n = 23: there are \(\frac{23\cdot 22}{2} = 253\) pairs, so the exponent is \(-\frac{253}{365} \approx -0.6932\). Then \(e^{-0.6932} \approx 0.5000\), so \(p \approx 1 - 0.5000 = 0.5000\), or about 50%. This is close to the exact 50.73%; the approximation is slightly low but good for quick estimates.
Interpreting the Result and Model Assumptions
What p(n) means. The result is the probability that at least one pair among the n people shares a birthday. It is not the probability that someone matches a specific person, such as you. The complement, \(1-p(n)\), is the probability that all n birthdays are distinct. That is why the answer climbs so fast: the number of pairs grows roughly with \(n^2\), not with n.
Matching a specific person is much less likely. For a given person to share a birthday with at least one of the other n−1 people, the probability is \(1-\left(\frac{364}{365}\right)^{n-1}\). With 22 other people that is only about 5.9%.
Key thresholds (365 equally likely days)
- At n = 23, the probability first exceeds 50% (about 50.73%). At n = 22 it is about 47.57%.
- At n = 57, the probability first exceeds 99% (about 99.01%).
Model assumptions
- Uniform birthdays. The model assumes every day is equally likely. Real birth dates are not uniform; they cluster seasonally and by day of the week. Any non-uniformity raises the true probability of a match, so the uniform result is a slight underestimate.
- Leap day. Using 366 days with February 29 changes results only marginally. Because February 29 is rare, it behaves almost like an extra day with very low probability, and the effect is small.
- Independence. The model assumes people are unrelated and independently chosen. Twins, family members, or groups selected by birth date (such as a school year cohort) break this assumption.
FAQ
Why does it work with so few people? Because a group of 23 people contains 253 possible pairs, and each pair is a fresh opportunity for a match.
What happens at 366 people? By the pigeonhole principle, with only 365 possible days a shared birthday is guaranteed, so the probability is exactly 100%.
Does it account for leap years? No. This model uses 365 equally likely days and excludes February 29, which keeps the classic result clean.