Birthday Problem Calculator | Shared Birthday Probability & Group Size
Compute the probability that at least two people in a group share a birthday using the exact combinatorial formula and Poisson approximation. Find the minimum group size for any target probability, and visualize how probability grows from n = 1 to 100.
Reference Table
| Group Size n | Exact P(shared) | Poisson Approx | Probability Bar |
|---|---|---|---|
| 10 | 11.69% | 11.60% | 11.69% |
| 20 | 41.14% | 40.58% | 41.14% |
| 23 | 50.73% | 50.00% | 50.73% |
| 30 | 70.63% | 69.63% | 70.63% |
| 40 | 89.12% | 88.20% | 89.12% |
| 50 | 97.04% | 96.51% | 97.04% |
| 57 | 99.01% | 98.74% | 99.01% |
| 70 | 99.92% | 99.87% | 99.92% |
| 100 | 100.00% | 100.00% | 100.00% |
Milestone Group Sizes
P = 50%
n = 23
P = 75%
n = 32
P = 90%
n = 41
P = 99%
n = 57
P = 99.9%
n = 70
What Is the Birthday Problem Calculator | Shared Birthday Probability & Group Size?
The birthday problem asks: in a room of n randomly chosen people, what is the probability that at least two share the same birthday? The answer is famously counterintuitive — most people guess the group needs to be much larger than it actually is.
- ▸With just 23 people, the probability of a shared birthday exceeds 50%.
- ▸With 57 people, the probability exceeds 99%.
- ▸The key is that we count any pair sharing a birthday, not a specific birthday.
- ▸In a group of n people there are C(n,2) = n(n−1)/2 possible pairs — 23 people create 253 pairs.
- ▸The Poisson approximation treats each pair as an independent event with probability 1/365, giving P ≈ 1 − e^(−pairs/365).
Formula
The birthday problem uses two complementary probability formulas. The exact formula works via logarithms to avoid numerical overflow.
P(n) = 1 − 365! / [(365−n)! · 365ⁿ]
Computed via log-sum to avoid overflow: ln P(no shared) = Σ ln(365−k) − n·ln(365)
P ≈ 1 − exp(−n(n−1) / 730)
Accurate for small n; error < 0.5% for n ≤ 50.
E[pairs] = C(n,2) / 365
Average number of pairs in the group that share a birthday.
min n : P(n) ≥ p
Found by binary search / sequential scan over n = 2, 3, … 366.
How to Use
- 1
Select Forward mode to compute probability for a given group size, or Reverse mode to find the minimum group size for a target probability.
- 2
In forward mode, drag the slider or type a group size n between 2 and 366.
- 3
Click Calculate Probability to see the exact probability, Poisson approximation, and approximation error.
- 4
In reverse mode, enter your target probability as a percentage (e.g. 50 for 50%) and click Find Minimum Group Size.
- 5
Consult the reference table for probabilities at landmark group sizes n = 10, 20, 23, 30, 40, 50, 57, 70, 100.
- 6
Check the milestone panel to instantly see the group size required for 50%, 75%, 90%, 99%, and 99.9% coincidence probability.
- 1
Choose a mode
Forward mode: enter a group size and see the probability. Reverse mode: enter a target probability and find the minimum group size needed.
- 2
Set group size with the slider or text box
The slider ranges from 2 to 100. Type directly for sizes outside the slider range (up to 366).
- 3
Click Calculate
The calculator shows the exact probability, the Poisson approximation, and the approximation error.
- 4
Use the reference table
The table shows probability at key milestones (n = 10, 20, 23, 30, 40, 50, 57, 70, 100) with probability bars.
- 5
Check the milestone panel
See at a glance the group size needed for 50%, 75%, 90%, 99%, and 99.9% probability.
Example Calculation
Example 1 | The Famous n = 23 Result
With exactly 23 people in a room, the probability that at least two share a birthday crosses 50% for the first time.
C(23,2) = 253 pairs. Each pair has a 1/365 ≈ 0.27% chance of matching. 253 "near-independent" chances compound to give 50%+ overall probability.
Example 2 | Reverse Lookup at 99%
How many people do you need for a 99% chance of at least one shared birthday?
Example 3 | Expected Number of Shared Pairs
In a group of 30, the expected number of pairs sharing a birthday is C(30,2)/365 = 435/365 ≈ 1.19 pairs.
Understanding Birthday Problem | Shared Birthday Probability & Group Size
The Birthday Paradox Explained
The birthday problem is one of the most famous results in probability theory, known as a "paradox" not because it involves a logical contradiction but because the answer is deeply counterintuitive. When asked to guess how many people you need for a 50-50 chance of a shared birthday, most people guess somewhere between 100 and 183 — the answer of 23 consistently surprises them.
The resolution is that our intuition focuses on a specific birthday (what is the probability someone shares my birthday?), while the problem asks about any shared birthday among any pair. The difference is enormous because the number of pairs grows quadratically with group size.
Real-World Applications
- ▸Cryptographic hash collisions: Birthday attacks find two inputs that produce the same hash output. For an n-bit hash, collision probability reaches 50% at about 2^(n/2) attempts.
- ▸Database primary key collisions: When generating random IDs, the birthday formula tells you when duplicates become likely.
- ▸DNA profiling: Courts use birthday-problem mathematics to assess the probability of a coincidental DNA match in a population.
- ▸Classroom demonstrations: The problem is a classic first lesson in probability because the result is verifiable empirically and the math is accessible.
Milestone Summary
| Group Size n | Probability | Why it matters |
|---|---|---|
| 23 | ≈ 50.7% | First n where probability exceeds 50% |
| 32 | ≈ 75.3% | Three-quarter probability threshold |
| 41 | ≈ 90.3% | Nine-in-ten chance of a match |
| 57 | ≈ 99.0% | Commonly cited "near certainty" threshold |
| 70 | ≈ 99.9% | One-in-a-thousand chance of no match |
Frequently Asked Questions
Why does the birthday probability reach 50% with only 23 people?
Most people expect the threshold to be around 183 people (half of 365) because they think about matching one specific birthday. But the birthday problem asks about any two people in the group sharing any birthday. With 23 people there are C(23,2) = 253 pairs, and each pair has a 1/365 ≈ 0.27% chance of matching. These 253 near-independent chances combine to give a 50%+ probability. The number of pairs grows as n², which is why probability increases so much faster than people expect.
What is the Poisson approximation and how accurate is it?
The Poisson approximation treats each of the C(n,2) pairs as an independent event with probability 1/365, giving P ≈ 1 − exp(−n(n−1)/(2·365)). It overestimates probability slightly because the pairs are not truly independent (person A's birthday affects both their pair with B and their pair with C). The error is less than 0.5% for n ≤ 50 and grows to about 3% at n = 100. The exact formula computed via logarithms is always more accurate.
Does the birthday problem assume birthdays are uniformly distributed?
Yes — the standard model assumes each birthday (day of the 365-day year, excluding Feb 29) is equally likely with probability 1/365. In reality, birth rates vary slightly by month and day, with a slight peak in late summer in many countries. Non-uniform distributions actually increase the probability of a shared birthday compared to the uniform case, because concentration on popular days creates more collision opportunities. The uniform assumption gives a lower bound on the real probability.
What happens at n = 366?
By the Pigeonhole Principle, with 366 people and only 365 possible birthdays (ignoring Feb 29), it is guaranteed that at least two people share a birthday — P(366) = 1 or 100%. The probability reaches 99.99% already at n = 100 and is effectively certain well before 366. At exactly n = 365, P ≈ 1 − 365!/365^365 which is astronomically close to 1.
Where is the birthday problem used outside mathematics class?
The birthday problem has important applications in computer science and cryptography. Hash collision attacks exploit the same mathematics: in a set of n hashed values, the probability of a collision follows the birthday curve with 365 replaced by the hash space size. For a 64-bit hash (2^64 ≈ 1.8 × 10^19 values), around 2^32 ≈ 4 billion samples give a 50% collision probability — far fewer than the 2^64 one might naively expect. This "birthday attack" is why modern cryptographic hashes need 256+ bits.
You Might Also Like
Explore 360+ Free Calculators
From math and science to finance and everyday life — all free, no account needed.