What the birthday paradox says, and when this calculator is useful
The birthday paradox asks a simple question: in a group of n people, what is the chance that at least two of them have the same birthday? It is called a paradox only because the answer clashes with intuition, not because anything in the logic is contradictory. Assume a 365-day year with every date equally likely, and the probability passes 50% with just 23 people. Intuition tends to suggest a far larger group, because "half of 365" feels like the natural threshold and we quietly substitute a different question: "will someone share my birthday?" Use this tool to test a real group such as a class, a team or a club, to demonstrate probability intuition in a lesson or talk, or to get a feel for how quickly collisions appear when random values are drawn from a limited set.
The method: count the ways nobody matches
Counting every way that "at least one pair matches" is messy, because a group can contain one shared pair, two pairs, a triple and so on. The standard trick is to compute the complement instead: the probability that all n birthdays are different, then subtract it from 1. The first person can have any birthday (365/365). The second must avoid the first person's date (364/365), the third must avoid both (363/365), and so on.
P(all different) = 365/365 Γ 364/365 Γ β¦ Γ (365 β n + 1)/365P(at least one shared birthday) = 1 β P(all different)
Every factor is below 1, so the product shrinks quickly as the group grows. For 23 people the chance that everyone is different is about 49.27%, which leaves 50.73% for at least one shared birthday. For 22 people the figure is 47.57%, so 23 is the first group size that crosses one half.
Why the number grows so fast: it is about pairs, not people
The quantity that matters is the number of pairs that could match, which is n(n β 1)/2. Doubling the group roughly quadruples the pairs: 23 people give 253 pairs, 46 people give 1,035 pairs, and 100 people give 4,950. Each individual pair matches with probability only 1/365, but hundreds of nearly independent chances add up. That reasoning leads to the handy approximation P β 1 β eβn(nβ1)/730 (730 is 2 Γ 365). The "Approximation" figure in the calculator uses it. It is close to the exact value, a little low in the middle of the range, as the table below shows.
Reference table by group size
| People | Pairs | Shared birthday (exact) | Approximation | Someone matches you |
|---|---|---|---|---|
| 5 | 10 | 2.71% | 2.70% | 1.09% |
| 10 | 45 | 11.69% | 11.60% | 2.44% |
| 15 | 105 | 25.29% | 25.00% | 3.77% |
| 20 | 190 | 41.14% | 40.58% | 5.08% |
| 23 | 253 | 50.73% | 50.00% | 5.86% |
| 30 | 435 | 70.63% | 69.63% | 7.65% |
| 40 | 780 | 89.12% | 88.20% | 10.15% |
| 50 | 1,225 | 97.04% | 96.51% | 12.58% |
| 57 | 1,596 | 99.01% | 98.74% | 14.24% |
| 60 | 1,770 | 99.41% | 99.22% | 14.94% |
| 70 | 2,415 | 99.92% | 99.87% | 17.25% |
| 100 | 4,950 | 99.99997% | 100.00% | 23.78% |
Milestones: 50% is first reached at 23 people, 90% at 41, and 99% at 57. The last column is the odds that someone in the group shares the birthday of one specific person, you. It is far lower for the same headcount, and it only passes 50% when the group has 254 people including you (253 others). The gap between 23 and 254 is the paradox in a nutshell: "any two people" has hundreds of ways to succeed, "someone matching me" has only n β 1.
Worked examples you can check by hand
Example 1: a group of 23. The product 365/365 Γ 364/365 Γ β¦ Γ 343/365 is about 0.4927, so the chance of a shared birthday is 1 β 0.4927 = 50.73%. The number of pairs is 23 Γ 22 Γ· 2 = 253.
Example 2: a class of 30. There are 435 pairs, and the probability is 70.63%. Roughly seven out of ten classes of this size would contain a pair with the same birthday, but any individual class may or may not.
Example 3: a small team of 10. There are 45 pairs and the probability is 11.69%. Even in a team this small, a shared birthday is not unusual: about one team in nine.
Example 4: checking the approximation at n = 23. n(n β 1)/730 = 506/730 β 0.6932, and 1 β eβ0.6932 β 50.00%. The exact answer is 50.73%, so the shortcut is off by only 0.73 percentage points.
Common mistakes and limits of the model
- Confusing "any pair" with "matches me". This tool's main result is about any two people in the group. The chance that someone has your birthday is the last column of the table and is much smaller.
- Reading 50% as a guarantee. With 23 people, about half of such groups have no shared birthday at all. The paradox is about probability, not certainty.
- Assuming birthdays are uniform. Real birth dates are not perfectly even across the calendar. Non-uniform birthdays generally make a match slightly more likely than the uniform model predicts, so the figures here are a reasonable baseline rather than a forecast for any specific population.
- Ignoring 29 February. The model uses a 365-day year. Including leap day changes the results only marginally.
- Groups that are not independent. Twins, siblings, or a gathering organized around a birth date break the assumption that each person's birthday is an independent draw.
- Large groups. With 366 or more people a match is certain by the pigeonhole principle (more people than dates), so the calculator accepts 2 to 365 and explains the certain case instead of printing a misleading figure.
Where the same idea shows up
In computing, the same calculation explains hash collisions and the "birthday attack". If a value can take N equally likely forms, a repeat among randomly drawn values becomes likely after roughly βN draws rather than N. Setting n(n β 1)/(2N) β ln 2 gives n β 1.18 βN, which for N = 365 gives about 22.5, matching the table. For a space of 65,536 values (16 bits) that works out to roughly 301 draws, and for 232 values to roughly 77,000. This is why short random identifiers, truncated hashes and small ticket-number ranges collide sooner than people expect, and why designers leave a generous margin in the size of the space. In teaching, the problem is a favorite for introducing the complement rule. At an event, a group of 25 to 40 people makes a lively demonstration: ask for birthdays around the room and see whether the maths holds.
How to use the result
Enter your real headcount and read the main figure as "how often a group this size would contain a match", not as a prediction for one particular group. If you are designing an identifier, ask the reverse question: how many items can I generate before the collision probability reaches a level I can tolerate, then size the space accordingly. If you are preparing a classroom demonstration, pick a group of at least 30 so that the likely outcome (about 71%) supports the story, and be ready to explain a miss.
Frequently Asked Questions
Does the calculation account for leap years?
No. It assumes 365 equally likely birthdays and leaves out 29 February. Adding the leap day shifts the results only very slightly, far less than the uncertainty in how evenly real birthdays are spread.
How is this different from the chance that someone shares my birthday?
It is a different question. The chance that at least one of the other n β 1 people has one specific birthday is 1 β (364/365)nβ1, and it needs 254 people to pass 50%. This calculator's main result concerns any two people in the group, which has many more ways to happen.
Why is 23 the magic number?
With 22 people the probability is 47.57%, just under half. With 23 it is 50.73%, the first whole number of people to exceed 50%.
Is the probability exactly 100% for 100 people?
No. For 100 people it is about 99.99997%, extremely close to certain but still not 1. Certainty arrives only at 366 people, when there are more people than possible dates.
Why bother with the approximation formula?
It lets you estimate by hand or in a spreadsheet without multiplying n fractions, and it generalizes directly to any number of possible values N, as in hashing and random-ID problems: P β 1 β eβn(nβ1)/(2N).