What Is a Binomial Test?
A binomial test is an exact hypothesis test that checks whether the number of successes in n independent trials fits a hypothesized probability of success (p₀).
The test adds up exact binomial probabilities instead of using a normal approximation, so the binomial test stays accurate for small samples such as 8 heads in 10 coin flips. Jacob Bernoulli described repeated yes/no trials in Ars Conjectandi (1713), and each trial in the test is a Bernoulli trial. For large samples, the Z Test Calculator offers the approximate proportion z-test.
Binomial Test Formula (Exact P-Value)
The probability of exactly k successes in n trials is P(X = k) = C(n, k) p₀ᵏ (1 − p₀)ⁿ⁻ᵏ.
The p-value adds the probabilities of every outcome at least as extreme as the observed count:
- Right-tailed: p = P(X ≥ k), the sum from k to n.
- Left-tailed: p = P(X ≤ k), the sum from 0 to k.
- Two-tailed: p = the sum of P(X = i) over every outcome i with P(X = i) ≤ P(X = k).
One-Tailed vs. Two-Tailed Binomial Tests
A one-tailed binomial test checks for a probability above or below p₀, and a two-tailed test checks for any difference. For 8 heads in 10 flips with p₀ = 0.5, the right-tailed p-value is 0.0547 and the two-tailed p-value is 0.1094. The two-tailed method used here, which adds outcomes no more likely than the observed one, is the method in R's binom.test.
Assumptions of the Binomial Test
The binomial test needs 4 assumptions:
- Two outcomes per trial: success or failure.
- A fixed number of trials (n) decided in advance.
- Independent trials: one outcome does not affect another.
- A constant probability of success (p₀) on every trial under H₀.
How to Use the Binomial Test Calculator
To use the binomial test calculator, follow 4 steps:
- Enter the number of successes (x) and the number of trials (n).
- Enter the hypothesized probability of success (p₀).
- Choose the tail.
- Set α.
The bar chart shows the exact probability of every possible count under H₀. Gold bars are the outcomes added into the p-value, the red bar is your result and the dashed line marks the expected count n·p₀. The cards compare the exact p-value with the normal-approximation p-value.
Interpreting Binomial Test Results
A p-value at or below α means the observed count is too far from n·p₀ to blame on chance. The p-value is exact, so no sample-size condition applies. The observed proportion x / n and Cohen's h show how far the result sits from p₀.
Binomial Test Examples
There are 2 worked examples below.
Example 1: 8 Heads in 10 Coin Flips
A coin lands heads 8 times in 10 flips. Is it fair?
- HypothesesH₀: p = 0.5, H₁: p ≠ 0.5
- P(X = 8)C(10, 8) × 0.5¹⁰ = 0.0439
- Two-tailed p-valueP(X ≤ 2) + P(X ≥ 8) = 0.1094
- Right-tailed p-valueP(X ≥ 8) = 0.0547
- DecisionFail to reject H₀ at α = 0.05: 8 heads in 10 flips is not enough evidence of bias.
Example 2: Defects in a Small Batch
A supplier claims a 5% defect rate. A batch of 20 parts holds 4 defects.
- HypothesesH₀: p = 0.05, H₁: p > 0.05
- Expected defects20 × 0.05 = 1
- Right-tailed p-valueP(X ≥ 4) = 0.0159
- DecisionReject H₀: the defect rate is higher than 5%.
Binomial Test vs. One-Proportion Z-Test
Use the binomial test for small samples, and the one-proportion z-test when np₀ ≥ 10 and n(1 − p₀) ≥ 10. In Example 1, the z-test gives p = 0.0578 against the exact two-tailed 0.1094, so the approximation is poor at n = 10. Test large samples with the one proportion z test calculator.
FAQs
Why is the two-tailed binomial p-value not just double the one-tailed value?
The two-tailed binomial p-value is not double the one-tailed value when p₀ ≠ 0.5, since the binomial distribution is then skewed. The method adds every outcome that is no more likely than the observed one, and those outcomes are not mirror images. With p₀ = 0.5 the distribution is symmetric, so the two methods match.
When is the sample large enough to use a z-test instead?
Use the one-proportion z-test when np₀ ≥ 10 and n(1 − p₀) ≥ 10. For p₀ = 0.5, that means n ≥ 20; for p₀ = 0.05, it means n ≥ 200. Below these limits, use the exact binomial test.
What is the sign test and how does it relate?
The sign test is a binomial test with p₀ = 0.5 applied to the signs of paired differences. Count how many pairs went up, drop the ties, and test the count against 0.5. The exact McNemar test is a sign test on the pairs that changed; run it with the McNemar test calculator.
How do I run a binomial test in Excel?
Use BINOM.DIST in Excel or Google Sheets. The right-tailed p-value for 8 or more successes in 10 trials is =1-BINOM.DIST(7,10,0.5,TRUE), which returns 0.0547. In R, use binom.test(8, 10, 0.5), and in Python, scipy.stats.binomtest(8, 10, 0.5).
How do I report a binomial test in APA format?
Report a binomial test with the count, the number of trials, p₀ and the exact p-value. Example: "4 of 20 parts were defective (20%), more than the claimed 5%, exact binomial test p = .016, one-tailed." For continuous measurements, find probabilities with the normal distribution probability calculator.