Math calculator

Birthday Paradox Calculator

Two questions that sound identical and are not.

Two questions, two very different answers

With 23 people and 365 equally likely days

50.7297%

That is the chance SOME pair shares a date. The chance someone shares YOUR date is only 5.8571% — a different question with a different answer.

Some pair matches

50.7297%

Someone matches you

5.8571%

22 other people

Pairs in the room

253

what the first question counts

Pairs involving you

22

what the second one counts

n = 231.0060.0
The two answers differ by a factor of 8.6612. Intuition counts people; the arithmetic counts pairs. With 23 people there are 253 pairs but only 22 that include you, so the general question grows as n² while the personal one grows as n. That single difference is the whole paradox — there is nothing counter-intuitive left once you count the right thing.
Reaching 50% takes 23 people for the pair question and 253 others for the personal one. Those are 23 and 253 — and 253 is also exactly the number of pairs in a room of 23. The same number twice, for entirely different reasons, which is a coincidence worth noticing rather than a connection. The pair threshold grows as roughly 1.18⋅√days, so it stays small even when the number of possibilities is enormous: 365 days needs only 23.

What this tool shows

In a room of 23, there is a 50.73% chance some pair shares a birthday — and a 5.86% chance anyone shares yours. Both are computed here, side by side, because the paradox is almost always explained without mentioning that the second question exists.

  • The chance any pair shares a date
  • The chance someone shares your specific date
  • The pair count that explains the gap
  • How many people each question needs for 50%
  • Any number of equally likely days, not just 365
  • The same maths applied to hash collisions
Both questions Pair count shown Any day count Exact, not simulated

A room of 23 holds 253 pairs; matching you takes 253 people.

Updated 8 September 2026 · Works in any browser, no installation

23 people give a better-than-even chance that two of them share a birthday. It feels wrong because 23 is small against 365 — but the comparison is not people against days. It is pairs against days, and 23 people make 253 pairs.

At a glance

Formula shown
P(at least one match) = 1 − (365/365)(364/365)…((365 − n + 1)/365) — the complement of everyone being different. For a specific date instead, P = 1 − (364/365)ⁿ⁻¹. The 50% threshold for the pair version is approximately 1.1774·√days, which is accurate to within 0.06% at a million days.
Scenario support
Explaining why a coincidence is not remarkable; classroom and team examples; hash collision and duplicate-ID risk; estimating how many samples before a repeat; any “what are the odds” question involving matches within a group.
Educational estimate
Planning support from the values you enter — not professional advice.

The question people think they are asking

Almost every telling of the birthday problem answers one question and leaves the audience believing it answered a different one.

The answer everyone quotes — 50.7% at 23 people — is about any pair. Somewhere in the room, two people match. It says nothing about whether either of them is you.

The chance that someone in a room of 23 shares your birthday is 5.86%. Nine times smaller, and much closer to what intuition expects. The tool prints both, because presenting only the first is where the sense of paradox actually comes from.

The mechanism is the pair count. A room of 23 contains 253 distinct pairs, but only 22 of them include you. The general question gets 253 chances to succeed; your personal question gets 22. That ratio is the entire explanation, and nothing about probability is being violated.

Reaching 50% on the personal question takes 253 other people. And 253 is exactly the number of pairs in a room of 23. The same number appears in both answers for completely unrelated reasons — a coincidence, not a connection, and a neat one to notice rather than to build an argument on.

The growth rates say it most compactly: pairs grow as n² and matches-with-you as n. Doubling the room roughly quadruples the first and merely doubles the second.

Why the complement is the only sane way to compute it

Computing this directly — adding up the ways exactly one pair matches, exactly two pairs match, and so on — is a combinatorial mess with heavy double-counting. The complement makes it three lines.

Ask instead for the probability that everyone is different. The first person can have any birthday. The second must avoid one date: 364/365. The third must avoid two: 363/365. Multiply, then subtract from 1.

This is the same move the probability calculator makes for “at least one”, and for the same reason: the complement of “at least one” is a single simple event, while the thing itself is a union of overlapping ones. Nearly every “at least one” problem is easier backwards.

It is also numerically safer. The product of 22 fractions each near 1 is computed exactly; an inclusion-exclusion sum over 253 pairs would alternate signs across terms of wildly different magnitudes and lose precision. The tool computes the product term by term rather than through factorials, which would overflow past n = 170 for no benefit.

One consequence worth stating: the answer is exact, not simulated. Every figure on this page is a closed-form product, so it does not wobble between page loads and does not depend on how many replications someone was willing to run.

The square-root law, and why it matters far beyond birthdays

The reason 23 feels too small is that the threshold does not scale with the number of days. It scales with the square root.

The 50% point is about 1.1774⋅√days. For 365 days that is 22.5, and the exact answer is 23. For a million days it predicts 1,177 and the exact answer is 1,178 — accurate to within 0.06%. The tool lets you change the day count and check this directly.

So multiplying the possibilities by a hundred only multiplies the threshold by ten. That is the whole surprise, expressed as a rate of growth rather than as a puzzle.

This is the birthday bound, and it sets real engineering limits. A hash function with N possible outputs starts producing collisions at around √N items, not N. A 32-bit identifier has 4.3 billion values and its first collision is expected at about 77,000 records — which is why auto-incrementing IDs get replaced by UUIDs, and why the replacement has to be much wider than the record count suggests.

In cryptography it halves your security in bits. A 128-bit hash offers 64 bits of collision resistance, because an attacker looking for any two messages that collide is running the birthday problem rather than searching for a specific target. This is precisely why hash lengths are chosen at double the bit strength actually required.

The same law also flatters coincidences. Any “what are the odds?” story involving a match within a group is usually far likelier than it sounds, because the storyteller counts people and the arithmetic counts pairs.

Real birthdays are not uniform, and it barely matters

Every calculation here assumes 365 equally likely days. Neither half of that is true, and the honest question is how much it changes the answer.

Births are not evenly spread. September is consistently the busiest month in the northern hemisphere, and scheduled deliveries make weekdays busier than weekends. There are visible dips around major holidays.

Any departure from uniformity makes matches more likely, never less. That is a theorem rather than an observation: the uniform distribution minimises the collision probability, so the figures on this page are a floor. Real-world estimates put the true 50% threshold at 23 people still — the effect is too small to move an integer.

29 February is the more interesting complication. It exists about once in 1,461 days rather than once in 365. Including it lowers the probability very slightly, because it adds a rarely-used slot. The convention here is to ignore it, which is standard and worth stating rather than assuming.

Twins break the independence assumption outright, and no adjustment to the day count repairs that. If the room contains a pair of twins the probability of a match is 1, and the model has nothing to say about it. Independence is the assumption that fails hardest here, exactly as it does everywhere else in elementary probability.

The practical summary: use 365 uniform days, know the answer is a slight underestimate, and do not use it on a group with a reason to cluster.

The variants people actually want

Four related questions, each with a genuinely different answer, and each asked as though it were the original.

“Same birthday as me” is the personal version, and the tool answers it directly: 1 − (364/365)n−1. It needs 253 others for a coin flip.

“Birthdays within a day of each other” collapses the threshold sharply — near-matches are far more common than exact ones, and only 14 people are needed for an even chance. Any “close enough” criterion multiplies the number of ways to succeed.

“Three people sharing” is much harder and takes about 88 people for an even chance. The jump from two to three is large because triples grow as n³ but each triple is far less likely than a pair.

“Same birthday AND same year” multiplies the day count by the span of years, so a room of colleagues spanning 40 birth years faces roughly 14,600 possible dates — and by the square-root law needs about 143 people rather than 23.

Each of these is the same complement calculation with a different denominator or a different definition of a match, which is why the tool exposes the day count directly rather than hard-coding 365.

Sources and methodology

References for the problem and its engineering form.

Method. Both probabilities are exact closed forms, not simulations. The pair version is computed as the complement of a running product — one factor per person — rather than through factorials, which would overflow past n = 170 and gain nothing; the personal version is a single power. Nothing here wobbles between page loads or depends on a replication count. The suite asserts 50.7297% at 23 people, 5.8571% for the personal question in the same room, that the 50% thresholds are 23 and 253 respectively, and that 253 also equals the number of pairs in a room of 23 — the coincidence the page points out, pinned so it cannot quietly become a claimed connection. It also checks the 1.1774⋅√days approximation against the exact threshold across four orders of magnitude, where it agrees to within 0.06% at a million days. That engine is verified on every change against 99 assertions. The count and the per-case breakdown are published on the formula verification page.

Related calculators

Where this goes next:

ProbabilityTwo events, repeated trials and Bayes, with the three usual errors handled — the dropped overlap in P(A or B), n×p instead of the complement, and the base rate that makes a 99% test 17% right.
Binomial Coefficientn choose k exactly on big integers, by the multiplicative formula that divides as it goes and never builds a factorial — with Pascal's rule and permutations beside it.
FactorialFactorials with every digit exact — 100 factorial is 158 of them — plus the trailing-zero count derived from Legendre's formula and Stirling's error.
Hypergeometric DistributionExact probabilities for drawing without replacement, with the binomial answer beside them and the 10% rule evaluated — at a 40% sampling fraction the binomial is 22% wrong, at 0.2% it is 0.06% wrong.
Poisson DistributionPoisson probabilities with a dispersion test against your own variance — because a Poisson forces variance to equal the mean, and real count data usually does not, which is exactly where the tail goes wrong.
Binomial DistributionExact binomial probabilities at any n — including thousands, where a factorial overflows — with the normal approximation beside them and its error measured, which is 0.6% at the centre and 261% in the tail.

More in Math, or browse all calculators.

Educational use disclaimer

An educational tool. It assumes equally likely, independent dates; real birthdays cluster slightly, which makes matches marginally more likely than shown, and twins break the independence assumption entirely.

How we calculate · Found an error? email us

Authorship & verification

Written and maintained by , a business operator who builds spreadsheet-based calculators.

What's changed (3 updates)

Published 8 September 2026

  1. Published a birthday problem calculator that answers both questions the paradox conflates: 50.73% that some pair in a room of 23 shares a birthday, and 5.86% that anyone shares yours. Presenting only the first is where the sense of paradox actually comes from.
  2. Reaching 50% on the personal question takes 253 other people, which is also exactly the number of pairs in a room of 23. The suite pins both numbers and asserts the equality is a coincidence rather than structural, so the page cannot quietly upgrade it into a derivation.
  3. Exposes the day count as an input, because the same square-root law governs hash collisions: a space of a million values starts colliding at about 1,178 items, and a 32-bit identifier at about 77,000 records.

Add this calculator to your site

Responsive embed — and private: nothing your visitors type leaves their browser.