User Rating 0.0 โ˜…โ˜…โ˜…โ˜…โ˜…
Total Usage 0 times
Presets:
1 – 10,000
0 – n
0.01 – 0.99 (0.50 = fair coin)
Is this tool helpful?

Your feedback helps us improve.

โ˜… โ˜… โ˜… โ˜… โ˜…

About

Misjudging coin-flip odds leads to flawed experimental design, lost bets, and broken simulations. A single fair coin produces a binary Bernoulli trial with p = 0.5, but sequences of n flips follow the binomial distribution B(n, p). This calculator computes the exact probability of observing k heads (or tails) in n flips, plus cumulative probabilities for "at least" and "at most" scenarios. It also supports biased coins where p โ‰  0.5. The tool uses the Lanczos log-gamma approximation to evaluate binomial coefficients C(n, k) accurately for n up to 10,000 without integer overflow.

Limitation: the model assumes independent, identically distributed trials. Physical coins exhibit slight bias (estimated 0.51 toward the starting face per Diaconis et al., 2007). For critical applications, adjust p accordingly. The cumulative computation iterates over the PMF, so extremely large n with mid-range k may take a moment. Pro tip: use the distribution chart to visually identify the mode and spread before committing to a sample size in an experiment.

coin flip probability binomial distribution calculator coin toss odds probability calculator statistics tool

Formulas

The probability of getting exactly k successes (heads) in n independent Bernoulli trials, each with success probability p, is given by the binomial probability mass function:

P(X = k) = C(n, k) โ‹… pk โ‹… (1 โˆ’ p)n โˆ’ k

The binomial coefficient is computed via log-gamma to avoid overflow:

C(n, k) = n!k! โ‹… (n โˆ’ k)!

In log-space: ln C(n, k) = lnฮ“(n + 1) โˆ’ lnฮ“(k + 1) โˆ’ lnฮ“(n โˆ’ k + 1)

Cumulative probabilities are obtained by summation:

P(X โ‰ค k) = kโˆ‘i=0 P(X = i)
P(X โ‰ฅ k) = 1 โˆ’ P(X โ‰ค k โˆ’ 1)

Expected value and standard deviation:

E[X] = n โ‹… p
ฯƒ = โˆšn โ‹… p โ‹… (1 โˆ’ p)

Where n = number of coin flips, k = desired number of heads (or tails), p = probability of heads on a single flip (0.5 for a fair coin), C(n, k) = binomial coefficient, ฮ“ = gamma function, ฯƒ = standard deviation.

Reference Data

Flips (n)Desired Heads (k)P(X = k)P(X โ‰ฅ k)Odds (1 in โ€ฆ)
1150.000%50.000%2
2225.000%25.000%4
3312.500%12.500%8
5331.250%50.000%3.2
553.125%3.125%32
10524.609%62.305%4.1
10711.719%17.188%8.5
10100.098%0.098%1,024
201017.620%58.810%5.7
20151.479%2.069%67.6
502511.227%55.614%8.9
50304.186%10.135%23.9
50400.009%0.013%10,907
100507.959%53.979%12.6
100601.084%2.844%92.3
100750.000%0.000%>106
2001005.635%52.817%17.7
2001200.060%0.141%1,670
5002503.566%51.780%28.0
10005002.523%51.262%39.6

Frequently Asked Questions

A fair coin has p = 0.5. Even a small bias, say p = 0.51, compounds over many flips. For n = 1000, the expected heads shifts from 500 to 510, and the probability of getting exactly 500 heads drops by roughly 15%. Diaconis et al. (2007) measured physical coins at approximately 0.51 bias toward the starting face. Use the bias slider in the calculator to model this.
Direct factorial computation overflows JavaScript's 64-bit floating point at n = 171 (since 171! > 10308). By working in log-space using the Lanczos approximation of lnฮ“(x), we compute ln C(n, k) as a sum of logarithms, then exponentiate only the final result. This is accurate to 15 significant digits for n up to 10,000.
"Exactly k" computes P(X = k), the point probability. "At least k" sums P(X = i) for i from k to n, answering "what are the chances of k or more?" 'At most k' sums from 0 to k. For example, with 10 fair flips, P(X = 7) โ‰ˆ 11.7%, but P(X โ‰ฅ 7) โ‰ˆ 17.2%.
Yes. The tallest bar in the PMF chart marks the mode, which for a fair coin equals floor((n + 1) โ‹… p). Approximately 68% of outcomes fall within ยฑ1ฯƒ of the mean, and 95% within ยฑ2ฯƒ. The chart visually highlights the selected k value so you can see exactly where it sits relative to the peak.
The normal approximation is generally reliable when both n โ‹… p โ‰ฅ 5 and n โ‹… (1 โˆ’ p) โ‰ฅ 5. For a fair coin, that means n โ‰ฅ 10. However, this calculator uses the exact binomial formula, so normal approximation errors never apply. The chart will visually show the bell-curve shape emerging around n = 20 - 30.
Use the complement rule: P(at least 1 head) = 1 โˆ’ P(0 heads) = 1 โˆ’ (1 โˆ’ p)n. For a fair coin with n = 10, this gives 1 โˆ’ 0.510 = 99.902%. In this calculator, set mode to "at least", k = 1.