โ† Home

๐ŸŽ‚ What are the odds two people share a birthday?

โ† Fun & Random

Put in the size of a room โ€” a class, a wedding, a team, a group chat โ€” and see how likely it is that two of the people in it share a birthday. The answer is much higher than intuition says, and the reason is that the room is being asked about every pair of people in it rather than about you.

The room

Anyone counts: a class, a team, a family dinner, the people at a party. Twenty-three is the famous number โ€” the size at which the chance passes fifty-fifty.
A leap day is a possible birthday like any other, which spreads a room of the same size a little thinner. Both figures are below.

Nothing is saved and nothing is sent anywhere. The arithmetic is exact and there is no data behind it: it assumes only that birthdays are spread evenly through the year and that the people are unrelated, and the fine print says what that costs.

The odds

Two of them share a birthday
โ€“
Two of them match
โ€“
Which is about
โ€“
One of them matches yours
โ€“
Which is about
โ€“
Pairs in the room
โ€“
People for a 99% chance
โ€“
Some pair matches Every birthday different

The whole curve, room by room

PeopleTwo of them matchOne matches yoursPairsThe chance

The arithmetic is exact; the assumptions behind it are not. It treats every day of the year as equally likely, and real birthdays are not spread evenly โ€” some months and some dates are busier than others, which makes a match slightly more likely than the page says. It also treats the people as unrelated, so a room holding twins, or a family, breaks the independence the sum relies on. And it answers one question only: whether any two of them share a birthday. That two people have the same birthday as each other is not asked, and neither is whether three of them do. Nothing here predicts anything about your party: it describes the shape of the coincidence, not whether it will happen on the night.

Why the answer is not a typo

Twenty-three people and a 50.7% chance reads like a mistake, because the question people think they are being asked is "does somebody here share my birthday", which is a much harder thing to find. The question the page answers is different: does any pair among the people in the room match? A room of 23 people is not 23 birthdays waiting to match one date โ€” it is 253 pairs of birthdays, and every one of those pairs is a chance to collide.

That number is worth sitting with. Twenty-three people make 23 ร— 22 รท 2 = 253 pairs, which is why a room that holds a fifteenth of a year's worth of dates is already more likely than not to hold a coincidence. The same counting explains why it climbs so fast afterwards: fifty people make 1,225 pairs, and at that point a shared birthday would be the surprise.

How it's worked out

The sum is done backwards, because that is the easy way round:

every birthday different = 365/365 ร— 364/365 ร— 363/365 ร— โ€ฆ

some pair matches = 1 โˆ’ that

one of them matches yours = 1 โˆ’ (364/365) to the power of (people โˆ’ 1)

  • Each new person multiplies the "all different" figure by the fraction of the year still unclaimed. With the room half full the multiplier is around a half; with it nearly full it is a sliver, which is why the chance bends upwards so sharply near the top.
  • The second question needs its own sum. Nobody has to match anybody else โ€” each of the others is simply compared with one date, yours โ€” so it is the same 364/365 repeated once per person, and it stays small for a long time.
  • The leap day is a selectable 366th possibility rather than an afterthought: including it gives the same room very slightly thinner odds, because there is one more date for everybody to avoid.
  • The page finds the thresholds by counting rather than by quoting them: 23 people for better than even, 41 for 90%, 57 for 99%. Those are the smallest rooms that reach each figure, computed one person at a time.

Where it comes from, and where it turns up

The problem is usually credited to Harold Davenport, and it has been asked ever since as the standard demonstration that probability is not intuition: the same trick โ€” a room full of pairs, rather than a room full of people against one date โ€” is the first surprise in most introductions to the subject.

It also has a day job. The same arithmetic is used in cryptography, where finding any two inputs that produce the same hash value is called a birthday attack, and where its conclusion is exactly as inconvenient as it is here: a hash half as long as you think you need collides far sooner than you think. Computing's answer to the party question is that collisions are cheap, and the birthday problem is why.

Where these numbers come from

  • The derivation, the 23-people and 253-pair figures, the "same birthday as you" version and the birthday attack all sit together in this reference on the birthday problem.
  • Every figure on this page is computed live in the browser rather than looked up: there is no table of data behind it, and nothing to go out of date. The 50.7% for 23 people is simply what the multiplication gives.
  • The two assumptions โ€” even spread and unrelated people โ€” are stated on the page rather than in a footnote, because they are the whole of what the arithmetic rests on.

Nothing here is a prediction, and no odds on this page are worth betting on or against: the coincidence either happens in the room or it does not, and the page only says how often it would, over a great many rooms like it.

Frequently asked questions

Why is 23 so much lower than I expected?

Because the room is not comparing 23 people with one birthday, it is comparing them with each other. Twenty-three people make 253 pairs, and every pair is a chance of a match โ€” which is why a room holding only a fifteenth of the year's dates is already more likely than not to hold a coincidence. The intuition that says "you would need about half the dates in the year" is answering a different question.

What about somebody sharing my birthday?

That is the smaller figure on the card, and it is a completely different sum. Your birthday is one fixed date, so each of the others has a 1-in-365 chance of landing on it: with 23 people the chance that one of them does is 5.9%, about 1 in 17. The room has to reach 254 people for that figure to pass fifty-fifty โ€” more than eleven times the 23 that the other kind of match needs, which is why the two figures on the card sit so far apart.

Does the leap day matter?

A little. Counting 366 possible birthdays rather than 365 gives every person one more date to avoid, so the chance of a match in a room of a given size drops very slightly. Choose it if you want the honest version for a room where a 29 February birthday is possible โ€” which is any room, really.

Are birthdays really spread evenly?

No, and the page says so. Real birth records show busier and quieter months, and even a few favourite dates: induced births and scheduled caesareans tend to avoid weekends and holidays. Uneven spread makes matches more likely than the even-spread figure rather than less, so the page's answer is a mild understatement.

How many people for a 99% chance?

57, and the page works it out rather than quoting it: that is the smallest room in which the chance first passes 99%. For 90% it is 41 people, and for better than even it is 23. If you want a room where the coincidence would be genuinely shocking, 100 people gives better than 99.99%.

What about twins, or a family in the room?

They break the arithmetic, and a page like this has no way to know. The sum assumes every person's birthday is independent of every other person's, which is false for twins and a little false for siblings in general, who cluster around their parents' timing. A room holding twins is far more likely to contain a shared birthday than the figure suggests.

Do three people sharing a birthday change this?

It is a different and rarer question, and the page does not answer it: it asks whether some pair matches, which a triple certainly satisfies. Three people sharing exactly the same date in a room of 23 is small by comparison โ€” about 1.3%, or one room in seventy-six โ€” which is why the card keeps the words "two of them" in front of the figure.

More calculators

Back to Fun & Random โ†’

๐Ÿ’ก Cozy's pick

Not sure where to go next? Let Cozy pick one of his favourites for you to try โ€” the lighter end of the site, picked at random, and never the one you are reading.