Birthday Paradox

Probability of a shared birthday in a group of n.

Open tool

Overview

The Birthday Paradox Calculator answers the classic probability puzzle: in a group of n people, what is the chance that at least two share a birthday? Enter a group size and it returns the exact probability, the complement (everyone has a unique birthday), and the smallest group needed to clear common thresholds like 50% or 99%.

Useful for statistics students working through the canonical pigeonhole-style example, cryptography learners studying hash-collision bounds, party planners curious about coincidences in a guest list, and teachers building intuition for why naive collision estimates dramatically underestimate real-world rates.

How it works

The probability of no shared birthday in a group of n is the product of (365 − k) / 365 for k from 0 to n − 1, assuming birthdays are uniformly distributed across a 365-day year and leap-day births are ignored. The probability of at least one match is the complement of that product.

For larger groups the same formula is applied iteratively in log-space to avoid floating-point underflow, and the threshold search uses a binary scan up to n = 365, after which the probability is exactly 1 by the pigeonhole principle. Real birthday distributions are slightly clustered around late summer, which would push the curve up a fraction of a percent — the tool reports the textbook uniform result.

Examples

n = 23 → 50.73% chance of a shared birthday
n = 30 → 70.63%
n = 50 → 97.04%
n = 70 → 99.92%

FAQ

Why is 23 the famous number?

Twenty-three is the smallest group size where the collision probability crosses 50%. The result feels counter-intuitive because people compare it to "does someone share my birthday," which is a different, much rarer event.

Does it count Feb 29?

No. The standard formulation uses a 365-day year. Including leap days lowers the probabilities by a fraction of a percent and is usually omitted for textbook clarity.

How does this relate to hash collisions?

The same square-root-of-N rule of thumb gives the expected number of hashes needed before a collision in a space of N values, which is why a 64-bit hash is considered weak against birthday attacks at around 2^32 inputs.

Are real birthdays uniformly distributed?

Not exactly — September births spike in many countries and Dec 25 / Feb 29 dip. The deviation is small enough that the uniform model is within one or two percentage points of empirical data.

What about a year of 366 days?

Substituting 366 lowers each probability by roughly 0.1 percentage points at n = 23 and is negligible above n = 40.

Try Birthday Paradox

An unhandled error has occurred. Reload ×