The birthday paradox calculator above returns the exact probability that at least two people in a group share a birthday. It computes the full product rather than the familiar exponential approximation, and it works for any number of people and any number of possible days, so the same page handles the classroom version with 365 days and the cryptographic version with billions of hash values.
Arb Digital publishes this because the birthday problem is the cleanest demonstration of a specific reasoning failure: people estimate the probability of a match by thinking about themselves rather than about pairs. The answer is not paradoxical at all once you count the pairs, and the calculator shows that count directly alongside the probability so the mechanism is visible rather than merely asserted.
What This Birthday Paradox Calculator Does
It computes one minus the probability that everybody has a different day, using the exact product of the shrinking fractions rather than any shortcut. It also reports three supporting quantities: the number of distinct pairs in the group, the expected number of matching pairs, and the probability that somebody shares your particular birthday, which is the number most people have in mind when they guess.
Alongside that it inverts the question. Give it a target probability and it searches upwards for the smallest group that reaches it. For 365 days the answers are worth knowing: 23 people for a coin-flip, 32 for three-quarters, 41 for nine in ten, and 57 for ninety-nine percent. The bars beside the result plot several group sizes at once so the shape of the curve is visible — it rises steeply through the middle and then flattens as it approaches certainty.
Our probability calculator handles single, compound and conditional event probabilities from first principles. This page is the specialised version for one specific and much-misread structure: the probability of any collision within a group. If you want the general machinery, use that page; if you want this particular question answered exactly, use this one.
How to Use It
- Enter the group size. Any whole number from one upwards. The classic result appears at 23.
- Set the number of possible days. 365 for the standard problem, 366 if you want to include February 29, or any other number to apply the same maths elsewhere.
- Set a target probability and read the group size needed to reach it in the fourth grid item.
- Compare the two probabilities. The headline is the chance any two people match; the working panel gives the chance somebody matches you specifically.
- Look at the bars to see the whole curve rather than a single point, which is the fastest way to build an intuition for it.
The Formula and How It Is Calculated
It is easier to compute the probability that nobody shares, and then subtract. Line the group up. The first person can have any of the d days. The second must avoid that one, so d − 1 of d days work. The third must avoid two, and so on. Multiplying those independent conditions gives P(all different) = (d−1)/d × (d−2)/d × … × (d−n+1)/d, and the answer you want is one minus that. Wolfram MathWorld's page on the birthday problem derives the same product and covers its generalisations.
With n = 23 and d = 365, that product comes to about 0.4927, so the probability of at least one shared birthday is about 0.5073 — just over half. The calculator carries the full product rather than approximating it, which matters at large values of d where the common exponential approximation drifts. It also handles the boundary correctly: as soon as n exceeds d, the probability is exactly one, because there are not enough distinct days to go round. That is the pigeonhole principle, and it is why a group of 366 people must contain a shared birthday even before any probability is involved.
The expected number of matching pairs is a separate and simpler calculation: the number of pairs, n(n−1)/2, divided by d. At 23 people there are 253 pairs, and 253 ÷ 365 is about 0.693 expected matches. Note that this is not the probability — expectation and probability are different quantities, and the expectation can exceed one while the probability cannot. Our permutation calculator and factorial calculator handle the counting side if you want to build the product by hand.
Why the Answer Feels Wrong: Pairs, Not People
The intuition that fails goes like this: there are 365 days and only 23 people, so the chance of a match must be small — roughly 23 out of 365, or six percent. That estimate is not merely low, it answers a different question. It is close to the probability that somebody shares your birthday, which for 23 people is about 6.0 percent, and the calculator reports that figure in the working panel so you can see the two side by side.
The real question involves every pair, not every person. With 23 people there are 253 distinct pairs, because each of the 23 can be paired with each of the other 22 and each pair is then counted twice. Two hundred and fifty-three chances at roughly one in 365 each is a very different proposition from 22 chances. The count of pairs grows with the square of the group size, which is why the probability climbs so much faster than people expect: doubling the group roughly quadruples the number of opportunities for a match.
The Same Maths Outside Birthdays: Hash Collisions
Change the number of days to a very large number and the calculator becomes a collision estimator. This is the birthday bound, and it governs how long an identifier has to be before duplicates become unlikely. The rule of thumb that falls out of the algebra is that a fifty percent chance of collision arrives at roughly 1.18 times the square root of d — the square root, not a fraction of d.
That square root is the whole point, and it has real consequences. A 32-bit identifier has about 4.3 billion values, which sounds ample, but the birthday bound puts a fifty-fifty collision at around 77,000 items, which is not ample at all. Anyone generating short random keys, order references or filenames and assuming that a namespace far larger than the item count is safe is relying on the same faulty intuition the birthday problem exposes. Enter 4294967296 as the number of days and any group size you like into the tool above and the effect is immediate.
Assumptions the Textbook Version Makes
The standard calculation assumes birthdays are spread uniformly across the year and that the people in the group are independent of one another. Neither is exactly true. Real birth records show a clear seasonal pattern, weekday births outnumber weekend births because of scheduled deliveries, and some dates are systematically avoided.
The useful thing about this particular deviation is that it only pushes in one direction. Any departure from a uniform distribution makes collisions more likely, never less, because clustering concentrates people onto fewer effective days. So the uniform-day answer is a lower bound on the real probability, and the true figure for a random group of 23 people is very slightly above 50.7 percent. Independence is a bigger practical concern: a group containing twins, or a class streamed by age, breaks the assumption in ways the model cannot capture. Penn State's STAT 500 applied statistics course covers the independence conditions that this product rule relies on.
Variations Worth Knowing
Three related questions sound similar and have quite different answers. The first is the one this page solves: at least one shared day anywhere in the group. The second is the probability that somebody matches a specific, named person, which is one minus ((d−1)/d) raised to the power n−1 — a much smaller number, and the one people usually estimate by mistake.
The third is the near-match problem: how many people before two share a birthday within a day of each other. Because each person now blocks three days rather than one, the group needed drops sharply, to around 14 for a fifty percent chance. This tool does not solve the near-match version, and it does not handle the triple-birthday variant either, which asks for three people on the same day and needs a much larger group — well over eighty for an even chance. Both need different combinatorics rather than a different number in the same formula. For the simpler repeated-trial questions our coin flip probability calculator and conditional probability calculator are the right starting points.
Arb Digital tests the assumptions behind marketing and analytics numbers rather than accepting the figure that feels right.
Browse All Free Tools Talk To Our TeamCommon Mistakes to Avoid
- Answering the wrong question — the chance that anyone matches anyone is far higher than the chance that someone matches you specifically.
- Estimating from people rather than pairs — the number of opportunities grows with the square of the group size, not in proportion to it.
- Confusing the expected number of matches with the probability — expectation can exceed one, probability cannot, and they are not interchangeable.
- Assuming a large namespace is safe — collisions become likely at around the square root of the number of possible values, not a fraction of it.
- Forgetting the pigeonhole boundary — once the group is larger than the number of possible days, a match is certain rather than merely likely.
Related Free Tools From Arb Digital
Work out event probabilities from scratch with the probability calculator, count arrangements with the permutation calculator, handle large factorials with the factorial calculator, model repeated trials with the binomial distribution calculator, or convert a proportion with the percentage calculator. The full free online tools hub lists every statistics tool we publish.
Frequently Asked Questions
Because 23 people form 253 distinct pairs, and each pair is a separate opportunity for a match. The number of opportunities grows with the square of the group size rather than in proportion to it.
No. The mathematics is straightforward and uncontested. It is called a paradox only because the correct answer conflicts sharply with most people's first guess.
Much lower. For 23 people it is about six percent, because you are asking about 22 comparisons against one fixed date rather than 253 comparisons between all pairs.
Fifty-seven, assuming 365 equally likely days. Certainty only arrives at 366 people, where the pigeonhole principle guarantees a shared day.
No. It multiplies the exact shrinking fractions rather than using the common exponential shortcut, which drifts noticeably when the number of possible days is very large.
Slightly, and always in the same direction. Any clustering makes collisions more likely, so the uniform-day figure is a lower bound on the true probability.
It is the same result applied to hash values. A fifty percent chance of a collision arrives at roughly the square root of the number of possible outputs, which is far sooner than most people expect.
This page explains a probability calculation for educational purposes. It assumes days are equally likely and people are independent, which real birth data only approximates.