Skip to content

Birthday Paradox Calculator

Type or slide the group size. Then watch the calendar simulation drop people onto random birthdays.

people
Chance at least two people share a birthday–
Chance every birthday is different–
Pairs of people compared–
Chance someone shares your birthday–

Calendar simulation

Each row is a month. People land on random days; when two land on the same day it lights up orange. February 29 is left out.

Groups with a match
–
Theory says
–

Updated: December 1, 2026Sources and method ↓

How do you calculate the birthday paradox?

The birthday paradox asks: how many people do you need in a room before it is more likely than not that two of them share a birthday? Most people guess somewhere around 180, half of 365. The real answer is 23.

The trick is to work out the opposite first: the chance that everyone has a different birthday. The first person can have any birthday. The second must avoid one day (364 out of 365), the third must avoid two (363 out of 365), and so on. Multiply those fractions together and subtract from 1.

P(shared birthday) = 1 − (365 × 364 × … × (365 − n + 1)) ÷ 365n

The calculation assumes 365 equally likely birthdays and ignores February 29. Real births are slightly uneven across the year, which actually makes a match a little more likely, not less.

Example: For 23 people, the chance that all birthdays differ is 365 × 364 × … × 343 ÷ 36523 ≈ 0.4927. So the chance that at least two share a birthday is 1 − 0.4927 ≈ 50.73%.

Why so few people?

Our intuition quietly compares everyone with ourselves. But the paradox is about any two people matching, and the number of possible pairs grows much faster than the group. With 23 people there are 23 × 22 ÷ 2 = 253 pairs, and each pair is a fresh 1-in-365 chance.

PeoplePairsChance of a shared birthday
104511.7%
2019041.1%
2325350.7%
3043570.6%
4078089.1%
501,22597.0%
571,59699.0%
702,41599.9%
Example: In a class of 30 students, the chance that two share a birthday is about 70.6%. So in roughly two out of three classes of that size, you should expect at least one shared birthday. At a 70-guest wedding the chance is above 99.9%.

What about someone sharing your birthday?

That is a much harder target. With n people in the room including you, the chance that at least one of the others matches your birthday is 1 − (364/365)n−1. In a group of 23 it is only 5.9%. To push it past 50% you need 253 other people, which is exactly the number of pairs in a group of 23. That neat coincidence is a good way to remember why the two questions are so different.

A rule of thumb

For a 50% chance of a match among d equally likely options, you need roughly 1.18 × √d items. For 365 days, 1.18 × √365 ≈ 22.5, which rounds to 23. The same rule explains why "hash collisions" in computer science turn up far sooner than people expect, a problem known as the birthday attack.

Why doesn't the simulation match the theory exactly?

A simulation is a set of random trials, so the share of groups with a match wanders around the true value. With 100 groups of 23, getting anywhere from about 40 to 60 matches is perfectly normal. Run more groups and the observed percentage settles closer to 50.7%. The simulation uses your browser's cryptographic random number generator, so every day of the year is equally likely.

Where does this show up in real life?

Beyond classrooms and office parties, the same math underlies cryptography, checks for duplicate records in databases and the odds of two lottery draws repeating a number combination. If you enjoy counterintuitive probability, try the Monty Hall problem, see what your real chances are in the lottery odds calculator, or count possible groups with the combination calculator.

Frequently asked questions

What is the birthday paradox?
It is the surprising fact that in a group of just 23 people, the chance that two share a birthday is over 50%. It feels wrong, which is why it is called a paradox, but the math is solid.
What are the odds of two people sharing a birthday in a group of 23?
About 50.73%. It is 1 minus the product 365 × 364 × … × 343 divided by 365 to the power of 23.
How many people do you need for a guaranteed shared birthday?
366 people, or 367 if you count February 29. But with just 70 people the chance is already above 99.9%.
What are the odds someone shares my birthday?
With n people including you, it is 1 − (364/365)^(n−1). In a group of 23 that is only 5.9%, and you need 253 other people to pass 50%.
What is the chance of a shared birthday in a class of 30?
About 70.6%, so roughly two out of every three classes of 30 have at least one pair of students with the same birthday.

Sources: Probabilities on this page are calculated with the standard product formula, assuming 365 equally likely birthdays and excluding February 29. The simulation uses the browser's cryptographic random number generator (crypto.getRandomValues).

Last updated: December 1, 2026

Results are for information only. For official or financial decisions, consult a qualified professional.

You might also need