User Rating 0.0
Total Usage 0 times
Range: 2 – 10,000 people
Default 365. Use 366 for leap year.
Presets:
Adjust the group size and press Calculate
Is this tool helpful?

Your feedback helps us improve.

About

The Birthday Paradox states that in a group of just 23 people, the probability of at least two sharing a birthday exceeds 50%. This result is counterintuitive because humans compare themselves against the group (1365) rather than counting all n(n 1)2 pairwise comparisons. The paradox is not a true paradox but a failure of probabilistic intuition. Misunderstanding this principle leads to flawed collision estimates in hash functions, flawed cryptographic nonce generation, and underestimation of duplicate risk in datasets. This calculator computes exact probabilities using the complement method with logarithmic accumulation to maintain numerical precision for groups up to 10,000. It assumes uniformly distributed birthdays across d days and ignores leap years by default, though a custom day count is supported.

birthday paradox probability calculator combinatorics birthday problem statistics pigeonhole principle shared birthday probability

Formulas

The probability that all n people in a group have distinct birthdays across d possible days is computed as:

P(no match) = n1k=0 d kd = d!dn (d n)!

The probability of at least one shared birthday is the complement:

P(match) = 1 P(no match)

For numerical stability with large n, the logarithmic form is used:

ln P(no match) = n1k=0 ln(1 kd)

The well-known approximation using the Taylor expansion ln(1 x) x yields:

P(match) 1 en(n1)2d

Where: n = number of people in the group, d = number of possible equally-likely birthdays (default 365), k = iteration index, P(match) = probability that at least two people share a birthday.

Reference Data

Group Size (n)Probability of Shared BirthdayOdds (approx.)Notable Context
20.274%1 in 365Single pair comparison
52.71%1 in 37Small team
1011.69%1 in 9Dinner party
1525.29%1 in 4Small classroom
2041.14%2 in 5Tutorial group
2350.73%Better than evenThe classic threshold
3070.63%7 in 10School class
4089.12%9 in 10Large lecture section
5097.04%33 in 34Office floor
5799.01%100 in 10199% threshold
7099.92%1,249 in 1,250Near certainty
10099.99997%3.3M in 3.3M+1Lecture hall
183> 99.999...%Pigeonhole imminentHalf of 365
366100%GuaranteedPigeonhole Principle
All values assume d = 365 equally likely days (no leap year).

Frequently Asked Questions

The common mistake is framing the question as "what is the chance someone shares MY birthday" (which is roughly n/365). The actual question counts ALL pairwise comparisons. With 23 people there are 23 × 22 / 2 = 253 distinct pairs. Each pair has a 1/365 chance of matching, and these overlapping events compound rapidly. The quadratic growth of pairs versus the linear growth of people is the core of the paradox.
Real-world birthdays are not uniformly distributed. Studies show clustering in September (in the Northern Hemisphere) and lower birth rates on holidays. Non-uniform distributions actually increase collision probability compared to the uniform model. Therefore, the calculator provides a conservative lower bound. For 23 people, the true probability with real-world data is slightly above 50.73%.
When n > d, the Pigeonhole Principle guarantees at least one collision. With d = 365, any group of 366 or more people must contain at least one shared birthday with probability exactly 1.0 (100%). The calculator correctly returns this for any n ≥ d + 1.
The Birthday Attack exploits this principle to find hash collisions. A hash function with an output of b bits has 2^b possible values. By the birthday bound, approximately 2^(b/2) random inputs are needed to find a collision with ~50% probability. This is why SHA-256 (256-bit output) provides 128-bit collision resistance rather than 256-bit. The calculator generalizes this by allowing custom values for d (possible outcomes).
Direct multiplication of terms like (364/365) × (363/365) × ... produces values extremely close to zero for large n. Floating-point arithmetic (IEEE 754 double precision) has about 15-17 significant digits. Multiplying hundreds of terms near 1.0 accumulates rounding error and can underflow to exactly 0. Summing logarithms converts multiplication to addition, preserving precision. The final result is recovered via exponentiation: P(no match) = exp(Σ ln(1 − k/d)).
Yes. The "Days in Year" parameter accepts any integer from 2 to 100,000. This generalizes the birthday problem to any collision scenario: duplicate lottery numbers, hash collisions, or matching identifiers in a database. For example, setting d = 52 models the chance of two people in a group sharing the same birth week.