Birthday Paradox Calculator

The birthday paradox is one of probability's most counterintuitive results: it takes only 23 people for the odds of a shared birthday to pass 50 percent. This calculator computes that probability exactly for any group size and any number of equally likely days. It works by finding the chance that everyone has a distinct birthday and subtracting from one. Beyond party trivia, the same maths underlies the birthday attack in cryptography, where it sets how many hashes you must try before a collision becomes likely. Enter a group size and the number of days to explore.

0.00
0.00
0.00

Birthday paradox formula

P(all different) = (d/d) * ((d-1)/d) * ((d-2)/d) * ... * ((d-n+1)/d)
P(at least one shared) = 1 - P(all different)
Number of pairs = n * (n - 1) / 2
(d = days in the year, n = number of people)

The complement trick makes the calculation simple: it is far easier to count the ways everyone can differ than to count every possible match. The number of pairs grows roughly with the square of the group size, which is why collisions become likely so quickly.

Probability context

  • With 365 days, the probability first exceeds 50 percent at 23 people (about 50.7 percent).
  • At 30 people the probability is about 70.6 percent; at 50 people it is about 97 percent.
  • The same maths is the birthday attack on hash functions: a collision becomes likely after roughly the square root of the number of possible outputs.
  • The model assumes equally likely days and ignores 29 February; real clustering slightly raises the chance of a match.
  • The count of pairs, not the count of people, drives the rapid rise in probability.

Birthday paradox: frequently asked questions

What is the birthday paradox?

The birthday paradox is the surprising fact that in a group of just 23 people, there is about a 50 percent chance two of them share a birthday. It feels paradoxical because 23 seems small next to 365 days, but the probability grows fast because it counts every pair of people, not just matches to one person.

How is the shared-birthday probability calculated?

The easiest route is to find the probability that everyone has a different birthday, then subtract from 1. With d days in the year and n people, the chance all differ is d/d times (d-1)/d times (d-2)/d and so on for n terms. One minus that product is the chance at least two share a birthday.

Why is 23 the famous number?

With 365 equally likely days, the probability of a shared birthday first exceeds 50 percent at 23 people: it is about 50.7 percent. At 30 people it is about 70 percent, and at 70 people it is more than 99.9 percent. The calculator lets you check any group size to see this growth.

Does this assume birthdays are evenly spread?

Yes. The standard calculation assumes every day is equally likely and ignores 29 February. Real birthdays are slightly clustered in certain months, which makes a shared birthday marginally more likely, not less. The 365-day model is the textbook version and a very close approximation.

Can I change the number of days in the year?

Yes. The days input defaults to 365 but you can change it, for example to 366 to include leap day, or to a smaller number to model a different set of categories. The same formula applies to any number of equally likely buckets, which is why it appears in cryptography as the birthday attack.

Official sources

Reviewed by the CalculatorHub team, edited by James Graham, 16 June 2026. See our methodology.