Binomial Distribution Calculator
With n = 10 trials and a success probability of p = 0.3 on each, the chance of exactly k = 3 successes is P(X = 3) = 0.266828 (26.6828%), which as an exact fraction is 66706983/250000000 = 0.266827932. That is the binomial formula P(X = k) = C(n, k) × p^k × (1 − p)^(n − k) = C(10, 3) × 0.3^3 × 0.7^7 = 120 × 0.027 × 0.0823543. Enter your own n, p (as a decimal, a percent or a fraction) and k to get P(X = k), P(X ≤ k), P(X < k), P(X ≥ k) and P(X > k) together, with the mean np = 3, the variance 2.1, the standard deviation 1.449138, the mode, a bar chart with your region highlighted, and the full probability and cumulative tables.
Updated Runs in your browser: nothing you enter is uploadedHow this tool works
P(X = 3) = C(10, 3) × 0.3^3 × 0.7^7
P(X = 3) = 0.266828
In 10 trials with a success probability of 0.3 each, the chance of exactly 3 successes is 0.266828, or 26.6828%.
- P(X = 3)
- 0.266828 (26.6828%)
- P(X ≤ 3)
- 0.649611 (64.9611%)
- P(X < 3)
- 0.382783 (38.2783%)
- P(X ≥ 3)
- 0.617217 (61.7217%)
- P(X > 3)
- 0.350389 (35.0389%)
- Exact P(X = 3)
- 66706983/250000000 = 0.266827932
- Mean, μ = np
- 3
- Variance, σ² = np(1 − p)
- 2.1
- Standard deviation, σ
- ≈ 1.449138
- Mode (most likely k)
- 3
- Ways to place the successes, C(10, 3)
- 120
- Computed with
- exact fractions
np = 3 and n(1 − p) = 7. A common rule of thumb asks for both to be at least 10 before a normal curve stands in for the binomial distribution; here at least one is below 10, so the approximation is not reliable. For comparison, a normal curve with mean 3 and standard deviation 1.449138, with a continuity correction, gives P(X = 3) ≈ 0.269930 against the binomial value 0.266828.
With up to 60 trials every probability is computed as an exact fraction and only rounded for display.
Probability of each number of successes
Probability table
| k | P(X = k) | In the highlighted region? |
|---|---|---|
| 0 | 0.028248 | No |
| 1 | 0.121061 | No |
| 2 | 0.233474 | No |
| 3 | 0.266828 | Yes |
| 4 | 0.200121 | No |
| 5 | 0.102919 | No |
| 6 | 0.036757 | No |
| 7 | 0.009002 | No |
| 8 | 0.001447 | No |
| 9 | 0.000138 | No |
| 10 | 0.000006 | No |
Cumulative probability table
| k | P(X ≤ k) | P(X ≥ k) |
|---|---|---|
| 0 | 0.028248 | 1 |
| 1 | 0.149308 | 0.971752 |
| 2 | 0.382783 | 0.850692 |
| 3 | 0.649611 | 0.617217 |
| 4 | 0.849732 | 0.350389 |
| 5 | 0.952651 | 0.150268 |
| 6 | 0.989408 | 0.047349 |
| 7 | 0.998410 | 0.010592 |
| 8 | 0.999856 | 0.001590 |
| 9 | 0.999994 | 0.000144 |
| 10 | 1 | 0.000006 |
Heads in 10 fair coin flips: every probability, exactly
| Heads (k) | P(X = k) | P(X ≤ k) | P(X ≥ k) |
|---|---|---|---|
| 0 | 1/1024 = 0.0009765625 | 1/1024 = 0.0009765625 | 1 |
| 1 | 5/512 = 0.009765625 | 11/1024 = 0.0107421875 | 1023/1024 = 0.9990234375 |
| 2 | 45/1024 = 0.0439453125 | 7/128 = 0.0546875 | 1013/1024 = 0.9892578125 |
| 3 | 15/128 = 0.1171875 | 11/64 = 0.171875 | 121/128 = 0.9453125 |
| 4 | 105/512 = 0.205078125 | 193/512 = 0.376953125 | 53/64 = 0.828125 |
| 5 | 63/256 = 0.24609375 | 319/512 = 0.623046875 | 319/512 = 0.623046875 |
| 6 | 105/512 = 0.205078125 | 53/64 = 0.828125 | 193/512 = 0.376953125 |
| 7 | 15/128 = 0.1171875 | 121/128 = 0.9453125 | 11/64 = 0.171875 |
| 8 | 45/1024 = 0.0439453125 | 1013/1024 = 0.9892578125 | 7/128 = 0.0546875 |
| 9 | 5/512 = 0.009765625 | 1023/1024 = 0.9990234375 | 11/1024 = 0.0107421875 |
| 10 | 1/1024 = 0.0009765625 | 1 | 1/1024 = 0.0009765625 |
Eight worked examples
| Question | n | p | Asked | Probability | Mean (np) | Arithmetic |
|---|---|---|---|---|---|---|
| Exactly 5 heads in 10 fair coin flips | 10 | 1/2 | k = 5, P(X = k) | 0.246094 | 5 | Exact fractions |
| At least 8 heads in 10 fair coin flips | 10 | 1/2 | k = 8, P(X ≥ k) | 0.054688 | 5 | Exact fractions |
| A sample of 20 parts from a line where 5% are defective: at most 1 defective | 20 | 5% | k = 1, P(X ≤ k) | 0.735840 | 1 | Exact fractions |
| Guessing 10 four-option questions: 6 or more right by luck | 10 | 1/4 | k = 6, P(X ≥ k) | 0.019728 | 2.5 | Exact fractions |
| At least one six in 12 rolls of a die | 12 | 1/6 | k = 1, P(X ≥ k) | 0.887843 | 2 | Exact fractions |
| 15 free throws from an 80% shooter: fewer than 10 made | 15 | 0.8 | k = 10, P(X < k) | 0.061051 | 12 | Exact fractions |
| A survey of 100 people, 40% of whom agree: more than 45 agree | 100 | 0.4 | k = 45, P(X > k) | 0.131090 | 40 | Floating point |
| Exactly 500 heads in 1,000 fair coin flips | 1000 | 1/2 | k = 500, P(X = k) | 0.025225 | 500 | Floating point |
Mean, variance, standard deviation and mode
| n | p | Mean np | Variance np(1 − p) | Standard deviation | Mode |
|---|---|---|---|---|---|
| 10 | 1/2 | 5 | 2.5 | ≈ 1.581139 | 5 |
| 20 | 1/2 | 10 | 5 | ≈ 2.236068 | 10 |
| 10 | 0.3 | 3 | 2.1 | ≈ 1.449138 | 3 |
| 50 | 0.1 | 5 | 4.5 | ≈ 2.12132 | 5 |
| 100 | 0.3 | 30 | 21 | ≈ 4.582576 | 30 |
| 1000 | 0.5 | 500 | 250 | ≈ 15.811388 | 500 |
When the normal approximation works
| n | p | np | n(1 − p) | Both at least 10? | Asked | Binomial | Normal approximation | Difference |
|---|---|---|---|---|---|---|---|---|
| 10 | 0.3 | 3 | 7 | No | P(X ≤ 3) | 0.649611 | 0.634965 | 0.014646 |
| 100 | 0.05 | 5 | 95 | No | P(X ≤ 2) | 0.118263 | 0.125675 | 0.007412 |
| 20 | 0.5 | 10 | 10 | Yes | P(X ≤ 8) | 0.251722 | 0.251167 | 0.000555 |
| 30 | 0.5 | 15 | 15 | Yes | P(X ≤ 12) | 0.180797 | 0.180655 | 0.000142 |
| 50 | 0.3 | 15 | 35 | Yes | P(X ≤ 12) | 0.222866 | 0.220200 | 0.002665 |
| 100 | 0.4 | 40 | 60 | Yes | P(X ≤ 45) | 0.868910 | 0.869214 | 0.000304 |
| 1000 | 0.5 | 500 | 500 | Yes | P(X ≤ 490) | 0.273986 | 0.273976 | 0.000011 |
Binomial formulas, with the example filled in
| Quantity | Formula | Value for n = 10, p = 0.3 |
|---|---|---|
| P(X = k) | C(n, k) × p^k × (1 − p)^(n − k) | k = 3: 0.266828 |
| P(X ≤ k) | P(0) + P(1) + … + P(k) | k = 3: 0.649611 |
| P(X < k) | P(X ≤ k − 1) | k = 3: 0.382783 |
| P(X ≥ k) | 1 − P(X ≤ k − 1) | k = 3: 0.617217 |
| P(X > k) | 1 − P(X ≤ k) | k = 3: 0.350389 |
| Mean | np | 3 |
| Variance | np(1 − p) | 2.1 |
| Standard deviation | √(np(1 − p)) | 1.449138 |
| Mode | ⌊(n + 1)p⌋ (two modes if (n + 1)p is a whole number) | 3 |
How to calculate a binomial probability
- Check that the situation is binomial. There must be a fixed number of trials n, each with only two outcomes (success or failure), the same probability p of success every time, and independent trials. Counting heads in coin flips or defective parts in a sample from a large batch fits.
- Enter n, p and k. Type the number of trials (10 in the example), the probability of success on one trial (0.3, or 30%, or 3/10) and the number of successes you ask about (3).
- Choose the probability you want. Pick exactly k, at most k, fewer than k, at least k or more than k. All five are always listed; your choice drives the headline and the highlighted bars on the chart.
- Read the result. P(X = 3) = 0.266828. The same panel gives P(X ≤ 3) = 0.649611, P(X ≥ 3) = 0.617217, the mean 3, the standard deviation 1.449138 and the mode 3.
- Check the chart, the tables and the normal note. The bar chart shows the whole distribution with your region highlighted; the tables list every k. The note under the results says whether np and n(1 − p) are both at least 10, the usual condition for a normal approximation.
Frequently asked questions
- What is the binomial distribution?
- It is the distribution of the number of successes X in n independent trials that each succeed with the same probability p. It needs a fixed number of trials, two possible outcomes per trial, a constant p and independence. The probability of exactly k successes is P(X = k) = C(n, k) p^k (1 − p)^(n − k). For n = 10 and p = 0.3 it gives P(X = 3) = 0.266828.
- How do I calculate P(X = k) by hand?
- Multiply three things: the number of ways to choose which k trials succeed, C(n, k); the chance that those k succeed, p^k; and the chance that the other n − k fail, (1 − p)^(n − k). For n = 10, p = 0.3, k = 3: C(10, 3) = 120, 0.3^3 = 0.027 and 0.7^7 = 0.0823543, so P(X = 3) = 120 × 0.027 × 0.0823543 = 0.266827932.
- What is the difference between P(X ≤ k), P(X < k), P(X ≥ k) and P(X > k)?
- “At most k” (≤) includes k, “fewer than k” (<) stops one short of it, “at least k” (≥) includes k and everything above, and “more than k” (>) starts one above it. For n = 10, p = 0.3, k = 3: P(X ≤ 3) = 0.649611, P(X < 3) = 0.382783, P(X ≥ 3) = 0.617217 and P(X > 3) = 0.350389. The difference between ≤ and < is exactly P(X = 3) = 0.266828.
- How do I find “at least” and “more than” probabilities?
- Use the complement. P(X ≥ k) = 1 − P(X ≤ k − 1), and P(X > k) = 1 − P(X ≤ k). For k = 3: P(X ≤ 2) = 0.382783, so P(X ≥ 3) = 1 − 0.382783 = 0.617217. The calculator sums the upper tail directly, so a very small “at least” probability keeps its precision instead of being the rounding error of 1 minus a number close to 1. For example, at least one six in 12 rolls of a die is 0.887843.
- What are the mean, variance and standard deviation of a binomial distribution?
- The mean is np, the variance is np(1 − p) and the standard deviation is the square root of the variance. For n = 10 and p = 0.3: mean 3, variance 2.1, standard deviation 1.449138. These come from treating X as the sum of n independent yes/no trials, each with variance p(1 − p).
- What is the mode of a binomial distribution?
- The mode is the most likely number of successes: ⌊(n + 1)p⌋, the largest whole number not above (n + 1)p. When (n + 1)p is itself a whole number, two neighbouring values tie. For n = 10 and p = 0.3 the mode is 3; for n = 11 and p = 1/2 the calculator reports 5 and 6 because both have probability 0.225586.
- When can I use the normal approximation to the binomial?
- A common rule of thumb asks for np and n(1 − p) to both be at least 10; some textbooks accept 5. Then X is close to a normal distribution with mean np and standard deviation √(np(1 − p)), and a continuity correction (adding or subtracting 0.5 from k) improves it. For n = 100, p = 0.4, k = 45: the exact P(X ≤ 45) is 0.868910 and the normal approximation gives 0.869214. The calculator prints this check, with both numbers, for whatever you enter, and the normal-approximation table above shows cases where it fails, such as small np.
- How exact is the calculator?
- Up to 60 trials p is read as an exact fraction and every probability is an exact fraction too, rounded only for display (the example is exactly 66706983/250000000 = 0.266827932). Above 60 trials, up to 1,000, the values are computed in double precision from logarithms and a ratio recurrence out from the mode, with each tail summed from its own small end. They were checked against SciPy’s scipy.stats.binom and agree to at least 10 significant digits, including far tails.
- Can I enter the probability as a percent or a fraction?
- Yes. p can be a decimal (0.3), a percent (30%) or a fraction (3/10 or 1/6); all are read as exact fractions, so 1/6 is not first rounded to 0.1667. A bare number above 1 that could be a percentage, such as 30, is rejected with a hint to write 30%, rather than guessed.
- Why does a probability show as “< 1e-300”?
- Above 60 trials the values are ordinary double-precision numbers, which cannot be smaller than about 1e-308. An extremely unlikely outcome (for example every one of 1,000 trials succeeding at p = 0.0001) is therefore shown as “< 1e-300” rather than as a misleading 0. Up to 60 trials an impossible outcome is an exact 0.
- Is it still binomial when I sample without replacement?
- Strictly, no: drawing from a small finite population without putting items back makes the trials dependent, and the hypergeometric distribution is the exact model. When the sample is a small part of the population, commonly under about 10% of it, the binomial distribution is a good approximation. Flips, rolls and draws with replacement are exactly binomial.
- Why is the number of trials limited to 1,000?
- Every k from 0 to n is computed so that the chart, the tables and the tail sums are all consistent, and 1,000 keeps each keystroke instant on a phone. The probability table shows every k for up to 30 trials and a window of 31 around your k beyond that; for more than 60 trials the chart shows the part of the distribution within about four standard deviations of the mean (widened to include your k when that stays readable).
How it works
X is the number of successes in n independent trials with success probability p: P(X = k) = C(n, k) p^k (1 − p)^(n − k), with mean np, variance np(1 − p) and mode ⌊(n + 1)p⌋. The inputs are read exactly: n and k are whole numbers (n from 1 to 1,000, k from 0 to n) and p is a decimal, a percent or a fraction held as a ratio of two big integers. For up to 60 trials, with p = a/b and c = b − a, each term is the integer C(n, k) a^k c^(n−k) over b^n, and sums add the integer numerators and divide once, so every probability and the mean and variance are exact fractions; they are rounded only when shown (6 decimals for probabilities, with the exact fraction printed when it is short). Above 60 trials the probabilities are double-precision numbers: the term at the mode is exp of ln C(n, m) + m ln p + (n − m) ln(1 − p), where ln C comes from the exact big-integer binomial coefficient, and the remaining terms follow from the recurrence P(k + 1) = P(k) (n − k) p / ((k + 1)(1 − p)) outward from the mode, which never divides by or subtracts tiny numbers. P(X ≤ k) is summed upward from k = 0 and P(X ≥ k) downward from k = n, so each tail is a sum of its own terms and keeps its relative precision. In the test suite these values are compared with SciPy’s scipy.stats.binom (pmf, cdf and sf) and agree to a relative 1e-11 or better, and the exact path is compared with Python fractions. The normal-approximation note uses the mean np and the standard deviation √(np(1 − p)) with a continuity correction of 0.5, for example P(X ≤ k) ≈ Φ((k + 0.5 − np) ÷ σ), with Φ from the shared normal distribution code, and reports the common rule of thumb that np and n(1 − p) should both be at least 10. The binomial model assumes independent trials with a constant p; it is an assumption about your situation that the calculator cannot check.
Sources
More free tools
- Sample Size CalculatorFind the sample size for a survey from confidence level, margin of error and expected proportion, with finite population correction, or the margin from n.
- Probability CalculatorFind P(A and B), P(A or B), P(not A) and P(A|B) for two events, binomial probabilities for repeated trials, and odds to probability, as exact fractions.
- Z-Score CalculatorFind a z-score from a value, mean and SD or a list of numbers, with percentile, left-tail, right-tail and two-tailed probability and a normal curve.
- Normal Distribution CalculatorNormal distribution probabilities from a mean and standard deviation: below, above, between two values, outside a range, or the value at a percentile.
- Correlation Coefficient CalculatorPaste x, y pairs for Pearson r, r², Spearman’s rho, the p-value, a Fisher z confidence interval for r, a strength guide, a rank table and a scatter plot.
- Percentile and Quartile CalculatorPaste numbers to get Q1, median, Q3, the interquartile range, outliers, any percentile and a value’s percentile rank, by three methods, with a box plot.
More: Statistics, probability and gradesAll math & numbersAll toolsHome & DIY calculators