At the 2014 World Cup in Brazil, each of the 32 national squads had exactly 23 players. James Fletcher, a reporter for the BBC, went through FIFA's official squad lists and checked every player's birthday. Result: 16 of the 32 teams had at least two players born on the same day of the year, the US team among them. Half the teams, which is exactly what the birthday paradox predicts. It is one of the most surprising results in probability, and you can check it with nothing more than middle school and high school math.
Here is where the number 23 comes from, how to compute it yourself, the mistakes to avoid, and why this classroom puzzle now sets the security level of the tools that protect digital documents.
What the paradox actually says
The statement fits in one sentence: in a group of 23 people, the probability that at least two of them share a birthday is greater than 50%. "Same birthday" means the same month and day, not the same year.
The word "paradox" is misleading. Nothing here is self-contradictory; the result just clashes with intuition. If you go with your gut, you might expect to need something like 183 people, half of 365. The real answer is about eight times smaller.
The puzzle is not new. Its first known appearance in print is a 1939 paper by the mathematician Richard von Mises, and it has been a staple of probability courses ever since, because it forces you to count carefully, and because you can test it in any large enough classroom.
Why your intuition gets it wrong
When you hear "23 people," you naturally picture yourself in the room: what are the odds that one of the other 22 shares my birthday? Those odds are low, under 6%. But that is not the question. The paradox is about any pair of people sharing a birthday, not just pairs that include you.
The number of pairs grows much faster than the number of people. With 23 people you can form 23 × 22 ÷ 2 = 253 different pairs, and each pair has a 1 in 365 chance of matching. With 253 chances for a coincidence, it is far less surprising that one of them hits. On average, a group of 23 contains 253 ÷ 365 ≈ 0.69 matching pairs.
Those pairs are not independent, though. If Alice and Ben share a birthday, and Ben and Chloe do too, then Alice and Chloe automatically match. So you cannot just add up the chances of the pairs. You need a cleaner method.
The step-by-step calculation, using the complement
Flip the question
"At least two people share a birthday" covers a huge number of cases: one pair, two pairs, three people on the same day, and so on. Counting them one by one would never end. The standard trick is to compute the probability of the complement, "everyone's birthday is different," and subtract it from 1. Compound events like this one first show up in 7th grade probability.
We start with two simplifying assumptions, which we will test later: a year has 365 days (we ignore February 29), and every day is equally likely to be a birthday.
Multiply, one person at a time
Let people walk into the room one by one.
- The first person can have any birthday: probability 365/365.
- The second must avoid the first person's day: 364 days out of 365 remain.
- The third must avoid two days: probability 363/365.
- And so on, until the 23rd person, who must avoid 22 days: probability 343/365.
Each factor is a conditional probability: the chance that the newcomer avoids the days already taken, given that everyone before had different birthdays. The probability that all 23 birthdays are different is the product of the 23 factors:
P(all different) = 365/365 × 364/365 × 363/365 × … × 343/365 ≈ 0.4927
The numerator, 365 × 364 × … × 343, counts the ways to hand out 23 distinct days to 23 people: it is a permutation, a staple of high school counting. The denominator, 365 to the 23rd power, counts every possible assignment.
So the probability that at least two people share a birthday is 1 − 0.4927 ≈ 0.5073, or 50.7%. With 22 people you get 47.6%, so 23 really is the smallest group where the odds pass one in two.
You can watch the "all different" probability melt as the group grows: 0.973 with 5 people, 0.883 with 10, 0.747 with 15, 0.589 with 20. Each newcomer has one more day to avoid than the one before, and those small losses compound.
23, 30, 50 and 70 people: the exact values
Extending the same product, computed with exact fractions, gives the probability of at least one shared birthday:
- 23 people: 50.7%
- 30 people, a full classroom: 70.6%
- 50 people: 97.0%
- 70 people: 99.92%, less than a 1 in 1,000 chance of no match at all
The 99% mark is passed at just 57 people. Absolute certainty, however, only arrives at 366 people (367 if you count February 29): with 365 possible days, 366 people cannot all have different birthdays. That is the pigeonhole principle, and it is the only way to reach 100%.
The classic mistake: "23 out of 365"
The most common error is to compare 23 directly with 365, as if the probability were 23 ÷ 365 ≈ 6.3%. That roughly answers a different question: is one of the 23 born on one specific date chosen in advance? It ignores the fact that the match can happen between any two people in the group.
The opposite mistake also exists: adding up the chances of all 253 pairs, which gives 253 ÷ 365 ≈ 69%. That is too high, because it counts several times the situations where more than one pair matches. Push the method a little further and it breaks: with 28 people there are 378 pairs, and you would get 378 ÷ 365, a "probability" greater than 1. You can only add probabilities of events that cannot happen at the same time.
Going through the complement avoids both traps. It is the move to remember for every "at least one" question.
Do the assumptions hold up?
February 29
In theory, about 1 person in 1,461 is born on February 29, since the day comes around once every four years (1,461 = 4 × 365 + 1). The BBC even spotted two 2014 World Cup players born on that day, Germany's Benedikt Höwedes and Algeria's Saphir Taïder. Adding this rare 366th day changes almost nothing: for 23 people, the probability of a match goes from 50.73% to 50.69%. The threshold stays at 23.
Births are not perfectly even
The second assumption is shakier. Births are not spread evenly over the year. A National Bureau of Economic Research study by Mireille Jacobson, Maria Kogelnik and Heather Royer found 18% fewer births in California on a major holiday and the day after, with scheduled C-sections accounting for about half of the drop. France's national statistics office, Insee, reports the same kind of pattern for 2015 to 2024: 22% fewer births than average on December 25 and 13% fewer on Sundays.
Does that unevenness work against the paradox? The opposite. Mathematicians have shown that the uniform distribution is the one that minimizes the chance of a match: as soon as some days are more likely than others, birthdays bunch up on them and matches become more common. The "365 equally likely days" assumption is the worst case, so with real births, 23 people are always enough.
The effect is tiny. Redoing the calculation with Insee's day-by-day birth figures moves the probability for 23 people from 50.73% to 50.74%. The only real party crashers are twins, who share a birthday by definition.
Sharing YOUR birthday is a different question
Here is another natural version: how many people do you need for a 50% chance that one of them was born on the same day as you? Now your birthday is fixed, and each other person has a 364 in 365 chance of missing it. With n other people, the probability that nobody matches you is (364/365) to the nth power, so:
P(at least one person shares your birthday) = 1 − (364/365)ⁿ
With the other 22 people in a group of 23, that is only 5.9%. With 100 people, 24.0%. You need 253 other people to pass 50% (50.05%); with 252 you are still at 49.9%.
Why not 183, half of 365? Because adding 1/365 a total of 183 times would double-count the cases where several people share your birthday. Once again, the chances do not add up; they combine through the complement.
And that 253 is no coincidence with the 253 pairs in a group of 23. In both cases you need about 365 × ln 2 ≈ 253 comparisons to have an even chance of a match. In a group of 23, those comparisons are the pairs; when you are hunting for your own birthday, it takes 253 people to make as many comparisons. Intuition answers the question "me against everyone else," while the paradox is about "everyone against everyone."
From birthdays to cryptography
Digital fingerprints
A hash function turns any file or message into a fixed-size "fingerprint," for example 256 bits for SHA-256. These fingerprints are used to check that a file has not been tampered with, and to create digital signatures: you sign the short fingerprint rather than the whole document. A good hash function must make it practically impossible to find a collision, two different inputs with the same fingerprint.
The birthday attack
With 365 possible values, a match becomes likely around 23 draws, roughly the square root of 365 times a small factor. This generalizes: if you draw at random from N possible values, you have an even chance of a repeat after about 1.18 × √N draws. For N = 365, the formula gives 22.5, and we are back at 23.
An n-bit fingerprint has 2 to the nth power possible values, but a collision becomes likely after only about 2 to the power n/2 tries. A 128-bit fingerprint therefore resists only about 2⁶⁴ tries, and a 160-bit one about 2⁸⁰. That is why current standards use 256-bit fingerprints: a birthday-style collision search would take on the order of 2¹²⁸ computations, far out of reach.
The attack was published by Gideon Yuval in 1979. Here is the scenario as the reference handbook by Menezes, van Oorschot and Vanstone describes it: a cheater prepares an honest message and a fraudulent one, then generates a huge number of variants of each by changing insignificant details. As soon as an honest variant and a fraudulent variant share a fingerprint, the cheater gets the honest one signed, and the signature works for the fraudulent one too.
Beating the bound: SHA-1
SHA-1 produces 160-bit fingerprints, so a birthday attack would take about 2⁸⁰ computations. In 2017, researchers from CWI Amsterdam and Google published the first full SHA-1 collision: two different PDF files with the same fingerprint. By exploiting weaknesses in the function, they needed only about 2⁶³ computations, roughly 6,500 CPU years and 100 GPU years, more than 100,000 times faster than brute force. The birthday bound is the best security a fingerprint can hope for, never a guarantee.
The takeaway
The birthday paradox is a reminder that in probability, asking the right question matters as much as the arithmetic. "Was anyone here born on my birthday?" and "Were any two people here born on the same day?" sound alike, but the first needs 253 people for even odds and the second only 23. The method never changes: go through the complement, multiply conditional probabilities, then check that the answer makes sense. Probability comes back in Algebra 2, and this is a good way to warm up.
In Mathflow, probability is practiced on three levels: Explore, to see the phenomenon before formalizing it; Explain, to spot where a line of reasoning goes off track; and Solve, to work problems on your own. When you get stuck, Alphi, the AI tutor, gives you a hint instead of the answer. The app was built with Inria, is used by more than 50,000 students, and is free to start.
Sources
- James Fletcher (BBC News), The birthday paradox at the World Cup, 2014
- Mireille Jacobson, Maria Kogelnik and Heather Royer (NBER), Holiday, Just One Day Out of Life: Birth Timing and Post-natal Outcomes, 2020
- Nathalie Blanpain (Insee), Quel jour naît-on le plus en France ? (in French), 2025
- Sukhada Fadnavis, A generalization of the Birthday problem and the chromatic polynomial, 2011
- Alfred Menezes, Paul van Oorschot and Scott Vanstone, Handbook of Applied Cryptography, Chapter 9: Hash Functions and Data Integrity, 1996
- Marc Stevens, Elie Bursztein, Pierre Karpman, Ange Albertini and Yarik Markov, The first collision for full SHA-1, 2017
