Binomial Distribution Calculator

Binomial probability calculator with a live bar chart. Exact P(X=k), cumulative, inverse and the normal approximation with continuity correction, for any n and p.

Runs in your browser

Whole-number outcomes only · n up to 10,000,000 · exact sums switch to the incomplete beta above n = 100,000

Exact binomial probabilities with a live bar chart: set the number of trials and the success probability, then read P(X = k), P(X ≤ k) and P(X ≥ k) together with the normal approximation.

See other distributions →

Real-world presets:
Binomial bar chart for n = 20. 10 bars are highlighted, total probability 0.588099.Normal approximation510150.588099

P(X ≤ 10) = 0.588099 · Normal approximation

Parameters

What to calculate

Type in either box — the other one is solved for you.

Boundary

Adds ±0.5 when approximating a discrete distribution with the normal curve.

Result

P(X ≤ 10)
0.588099 P(X ≤ 10) = Σ C(20, i) · 0.5^i · 0.5^(20−i) = 0.588099

Related probabilities

P(X ≤ x)
0.588099
P(X ≥ x)
0.588099
P(X = x)
0.176197
P(X < x)
0.411901
P(X > x)
0.411901
Two-tail probability
1.000000
z-score
0
Percentile
58.81th percentile

Distribution summary

Mean
10
Variance
5
Standard deviation
2.236068
Median
10
Mode
10
Skewness
0
Excess kurtosis
-0.100000

Normal approximation

MethodResultError
Exact0.588099
Approximation0.5000008.810e-2
With continuity correction0.5884683.698e-4

Probability table

kP(X = k)P(X ≤ k)P(X ≥ k)
30.0010870.0012880.999799
40.0046210.0059090.998712
50.0147860.0206950.994091
60.0369640.0576590.979305
70.0739290.1315880.942341
80.1201340.2517220.868412
90.1601790.4119010.748278
100.1761970.5880990.588099
110.1601790.7482780.411901
120.1201340.8684120.251722
130.0739290.9423410.131588
140.0369640.9793050.057659
150.0147860.9940910.020695
160.0046210.9987120.005909
170.0010870.9997990.001288

Same calculation in code

from scipy.stats import binom
binom.cdf(10, 20, 0.5)  # 0.5880985260009738

Turn on the continuity correction to see why ±0.5 matters — at n = 100, p = 0.5 it cuts the approximation error by about twenty times.

How to use

  1. Set the number of trials (n) and the success probability (p).
  2. Enter k to get P(X = k), P(X ≤ k) and P(X ≥ k) at once.
  3. Toggle the boundary between inclusive (≤) and exclusive (<) — for discrete data they differ.
  4. Turn on continuity correction to compare the exact answer with the normal approximation.

FAQ

When should I use the binomial distribution?

When the number of trials is fixed, each trial has only two outcomes, the success probability is the same every time, and the trials are independent — 20 coin flips, or inspecting 1000 items with a 1% defect rate.

What is the difference between P(X = k) and P(X ≤ k)?

P(X = k) is the probability of exactly k successes; P(X ≤ k) adds up everything from 0 to k. For 20 coin flips, P(X = 10) = 0.176197 while P(X ≤ 10) = 0.588099.

What is the continuity correction and when do I need it?

It widens the boundary by ±0.5 when a discrete distribution is approximated by the continuous normal curve. At n = 100, p = 0.5 the exact P(X ≤ 60) is 0.982400; the plain approximation gives 0.977250 (error 5.15e-3) and the corrected one 0.982136 (error 2.64e-4) — about twenty times better.

Is it still accurate when n is very large?

Above n = 100,000 the calculator stops summing terms one by one and evaluates the regularised incomplete beta function I₁₋ₚ(n−k, k+1) instead. Even at n = 10,000,000 the relative error stays around 4e-9.

Related tools

More AI & Data tools: AI & Data

Send feedback

Found a bug or have an idea? Tell us — it helps make the tools better.

Only needed if you would like a reply.

Page: /ai/binomial-distribution-calculator/