Birthday Paradox Calculator

Calculate the probability that at least two people in a group share a birthday, or the group size needed for any target chance, with a probability curve.

Find
365 for birthdays. Use other values for any “shared value” problem, e.g. 10,000 for 4-digit PINs.
P(match)
0.507297
P(all different)
0.492703
Pairs of people
253
Expected matching pairs
0.6932pairs ÷ d
Someone shares your day
5.8571%
P(at least two of 23 share a day)50.7297%0.507297 with d = 365 days
  • Assumes every day is equally likely and people are independent (no twins). Real birthdays are slightly uneven, which makes matches a little more likely, not less.

Show the work

  1. P(all 23 different) = (365/365) × (364/365) × … × (343/365) = 0.492703
  2. P(at least one shared) = 1 − 0.492703 = 0.507297
  3. Number of pairs: C(23, 2) = 253; approximation 1 − e−pairs/d = 0.500002
  4. Chance someone shares one particular person’s day: 1 − (1 − 1/365)22 = 0.058571
  • P(at least one shared day), %
020406080100171319253137434955P(at least one shared day), %
Group size needed for a given chance of a match (d = 365)
Chance of a matchPeople needed
10%10
25%15
50%23
75%32
90%41
95%47
99%57
99.9%70

The birthday paradox is one of the most surprising results in probability: in a room of just 23 people, it is more likely than not that two of them share a birthday. The calculator computes the exact chance for any group size, finds how many people you need for a target probability, and generalizes to any number of equally likely values, which makes it useful well beyond parties, for PIN codes, lottery numbers and hash collisions.

How to use the birthday paradox calculator

  1. Choose Chance of a match to enter a group size, or People needed to enter a target probability.
  2. Keep the number of days at 365 for birthdays, or change it to the number of possible values in your problem (10,000 for four-digit PINs, for example).
  3. Read the probability or group size on the tape. The curve shows how the chance climbs as the group grows, and the table lists the group sizes needed for common targets.

Birthday problem formula

It is easier to count the opposite event, that everyone has a different birthday. The first person can have any day, the second must avoid one day, the third must avoid two, and so on:

P(all different) = (d/d) × ((d − 1)/d) × … × ((d − n + 1)/d)
P(at least one match) = 1 − P(all different)

For a quick estimate, there are n(n − 1)/2 pairs, each matching with probability 1/d, so

P(match) ≈ 1 − e−n(n − 1)/(2d)  and  n50% ≈ 1.1774√d

Worked example

Take a class of 23 students and 365 equally likely birthdays.

  1. P(all different) = 365/365 × 364/365 × … × 343/365 = 0.492703.
  2. P(at least one shared birthday) = 1 − 0.492703 = 0.507297, or 50.73%.
  3. The class has 253 pairs, and the approximation gives 1 − e−253/365 = 0.500002, very close to the exact value.
  4. The chance that someone shares one particular student’s birthday is only 1 − (364/365)²² = 5.86%.

Running the calculator in reverse confirms the classic thresholds: 23 people for 50%, 41 for 90%, 57 for 99% and 70 for 99.9%.

Why intuition fails

People instinctively compare the group size with 365 and think 23 is far too small. The right comparison is the number of pairs, which grows roughly with the square of the group size. Ten people form 45 pairs; 23 form 253; 70 form 2,415. Each additional person brings a new pair with everyone already there.

Square-root scaling

Because pairs grow with n², the group size needed for a 50% chance grows only with the square root of the number of possible values. That rule has practical consequences:

Possible values (d) People for a 50% chance
365 (birthdays) 23
10,000 (4-digit PIN) 119
1,000,000 (6-digit code) 1,178

So among 119 people who each choose a random 4-digit PIN, two probably picked the same one.

Collisions in computing

The same mathematics sets the size of hash functions and random identifiers. A “birthday attack” finds two inputs with the same hash after roughly √d attempts, far fewer than the d attempts needed to match one specific value. That is why cryptographic hashes use outputs of 256 bits rather than 128.

For general two-event probability rules, see the probability calculator. The count of ordered arrangements of distinct days in the formula above is a permutation; the permutations calculator computes those exactly.

Frequently asked questions

Why do only 23 people give a 50% chance of a shared birthday?

Because the question is about any pair, not about you. Twenty-three people form 253 different pairs, and each pair has a 1-in-365 chance of matching. With that many chances, a match becomes more likely than not: the exact probability is 50.73%.

What is the chance that someone shares my birthday?

That is a different, much smaller probability. In a group of 23, the chance that at least one of the other 22 people has your birthday is 1 − (364/365)^22 ≈ 5.86%. You would need 253 other people to reach 50%.

How many people guarantee a shared birthday?

With 366 people, a match is certain if leap days are ignored, by the pigeonhole principle: there are only 365 possible birthdays. In practice the probability is already above 99.9% with 70 people.

Does the uneven spread of real birthdays change the answer?

Slightly, and in the direction of more matches. Births are not perfectly uniform across the year, and any unevenness makes collisions more likely than the equal-days model predicts. The textbook figure of 23 is therefore a slight overestimate of the group size needed.

What else is the birthday problem used for?

Any situation where many items are assigned random values from a fixed set: duplicate PINs or ticket numbers, hash collisions in computer science and cryptography, and random ID clashes. Set the number of days to the number of possible values to model these.

Last reviewed October 2026 by the CalcFluent editorial team. How we check our calculators.