Binomial Test Calculator

Test if an observed proportion differs significantly from an expected proportion

About Binomial Test

The binomial test is an exact test for the proportion of successes in a binary outcome.

It's used to test whether the observed success rate differs from an expected probability.

Unlike approximate tests, it gives exact p-values based on the binomial distribution.

What Is the Binomial Test?

The Binomial Test is an exact hypothesis test for proportions that uses the binomial distribution to determine whether an observed proportion differs significantly from an expected value. Unlike the z-test for proportions — which relies on normal approximation — the binomial test computes exact p-values directly from the binomial probability mass function, making it valid even for small sample sizes.

The test answers questions like: "Is this coin fair?"— if you flip it 20 times and get 15 heads, is that enough evidence to reject the null hypothesis that p = 0.5? Or "Does this drug work?"— if 8 out of 10 patients improve, is that significantly better than the 50% baseline response rate?

This calculator performs two-tailed, left-tailed, and right-tailed exact binomial tests, providing the p-value, observed proportion, expected proportion, and a z-score approximation for reference — plus a clear significance verdict at the standard α = 0.05 threshold.

The Binomial Test Formula

The binomial test evaluates how extreme the observed result is under the null hypothesis proportion p₀. It uses the binomial PMF directly to compute the probability of observing k successes (or a more extreme outcome) in n trials.

Binomial Test P-Value

P(X = k) = C(n,k) × p₀^k × (1−p₀)^(n−k)

Where:

  • n= Total number of trials (sample size)
  • k= Number of successes observed
  • p₀= Null hypothesis proportion (expected under H₀)
  • C(n,k)= Binomial coefficient — number of ways to select k from n

Interpreting Binomial Test Results

The p-value from the binomial test has the same interpretation as any p-value: it is the probability of observing a result as extreme as k (or more extreme), assuming the null hypothesis proportion is true. A small p-value provides evidence against H₀.

Test TypeP-Value Computed AsUse Case
Two-tailedSum P(X=i) for all i with prob ≤ P(X=k)"Is the proportion different?"
Left-tailedP(X ≤ k)"Is the proportion less?"
Right-tailedP(X ≥ k) = 1 − P(X ≤ k−1)"Is the proportion greater?"

The calculator also shows a z-score and standard error computed from the normal approximation: z = (p̂ − p₀) / √(p₀(1−p₀)/n). For large samples, the z-score provides a quick sanity check, but the exact p-value from the binomial distribution should always be used for formal inference, especially with small n or extreme proportions.

How to Use This Calculator

Performing a binomial test takes four inputs:

  1. Number of Successes: Enter the count of successful outcomes in your sample. Must be a non-negative integer not exceeding the number of trials.
  2. Number of Trials: The total number of independent observations. Enter a positive integer.
  3. Expected Proportion: The null hypothesis value p₀. Enter as a decimal between 0 and 1. The default 0.5 tests for a fair coin or equal probability.
  4. Test Type: Choose two-tailed (testing if the proportion differs from p₀ in either direction), left-tailed (testing if it is less), or right-tailed (testing if it is greater).
  5. Read the results: The calculator displays the exact p-value, observed proportion, probability of the exact result, z-score approximation, standard error, and whether the result is significant at α = 0.05.

Real-World Applications

The binomial test is widely used in clinical trials and medical research where outcomes are binary — response to treatment, survival at a milestone, or occurrence of an adverse event. When sample sizes are small, normal approximation z-tests can be unreliable, and the exact binomial test provides valid inference regardless of n.

In quality control and manufacturing, the binomial test checks whether a observed defect rate is consistent with a target. If a batch of 200 items shows 8 defects when the specification allows 2%, the binomial test determines whether this batch differs significantly from the standard. In genetics, the binomial test evaluates whether observed ratios of phenotypes deviate from expected Mendelian inheritance patterns (e.g., 3:1 for a monohybrid cross).

In survey analysis and polling, the binomial test determines whether observed approval ratings differ from a benchmark. In UX and conversion testing, it tests whether a variant's conversion rate is significantly different from the historical baseline.

Worked Examples

Testing a Coin for Fairness

Problem:

You flip a coin 20 times and observe 15 heads. Is the coin fair? Test at α = 0.05 using a two-tailed binomial test.

Solution Steps:

  1. 1Step 1: Enter successes = 15, trials = 20, expected proportion p₀ = 0.5, test type = two-tailed.
  2. 2Step 2: Observed proportion p̂ = 15/20 = 0.75. The probability of exactly 15 heads under H₀ is C(20,15)×0.5^20 = 15504/1048576 ≈ 0.0148.
  3. 3Step 3: The two-tailed p-value sums probabilities for all outcomes equally or less likely than 15 heads: P(X=0)+P(X=1)+...+P(X=5)+P(X=15)+...+P(X=20) ≈ 0.0414.
  4. 4Step 4: Compare p = 0.0414 to α = 0.05. Since p < 0.05, reject H₀ — the coin shows evidence of unfairness.

Result:

The exact two-tailed p-value is approximately 0.0414, which is below 0.05. There is statistically significant evidence that the coin is not fair. The observed proportion of 75% heads is unlikely under a fair-coin hypothesis.

Drug Efficacy One-Tailed Test

Problem:

A new drug is tested on 15 patients. 12 show improvement. A placebo historically has a 50% response rate. Is the drug significantly better (right-tailed test, α = 0.05)?

Solution Steps:

  1. 1Step 1: Enter successes = 12, trials = 15, p₀ = 0.5, test type = right-tailed.
  2. 2Step 2: Right-tailed p-value = P(X ≥ 12) = P(12)+P(13)+P(14)+P(15).
  3. 3Step 3: P(12)=C(15,12)×0.5^15=455/32768≈0.0139. P(13)=105/32768≈0.0032. P(14)=15/32768≈0.0005. P(15)=1/32768≈0.00003.
  4. 4Step 4: P(X ≥ 12) ≈ 0.0176, which is below 0.05. Reject H₀ — the drug shows significantly higher response rate.

Result:

The right-tailed p-value is approximately 0.0176, well below 0.05. There is strong evidence that the drug's response rate exceeds the 50% placebo baseline. 12 out of 15 (80%) is significantly better than chance.

Quality Control Defect Rate

Problem:

A specification allows at most 3% defects. In a sample of 100 items, 6 are defective. Test at α = 0.05 whether the defect rate exceeds 3% (right-tailed).

Solution Steps:

  1. 1Step 1: Enter successes = 6 (defects are 'successes' in binomial terms), trials = 100, p₀ = 0.03, test type = right-tailed.
  2. 2Step 2: Observed proportion = 6%. Under H₀(p=0.03), expected defects = 3. Right-tailed p-value = P(X ≥ 6).
  3. 3Step 3: Compute P(X=6)+P(X=7)+...+P(X=100). The calculator handles the summation efficiently.
  4. 4Step 4: If p-value exceeds 0.05, there is insufficient evidence to reject H₀ — 6 defects may be consistent with a 3% rate.

Result:

With p₀ = 0.03, the expected defect count is 3. Observing 6 defects has a right-tailed p-value of approximately 0.08-0.12 depending on exact computation — above 0.05. There is insufficient evidence at α = 0.05 to conclude the defect rate exceeds 3%, though the result is borderline.

Tips & Best Practices

  • Always pre-specify one-tailed vs two-tailed before seeing the data — switching after observing results inflates Type I error.
  • The binomial test is exact — trust its p-value over the z-score approximation, especially for small n.
  • With small samples, the test is conservative — p-values are slightly larger than they would be with continuous data.
  • For very large n, the z-score approximation converges to the exact result — but the binomial test still provides better accuracy.
  • Use right-tailed when testing for improvement (e.g., drug better than placebo), left-tailed for deterioration, two-tailed for 'any difference'.

Frequently Asked Questions

Use the binomial test when sample sizes are small (typically n < 30), when the expected proportion is extreme (p₀ near 0 or 1), or when you need exact p-values. The z-test relies on normal approximation which requires np₀ ≥ 10 and n(1−p₀) ≥ 10. The binomial test is always valid regardless of sample size but is computationally more intensive for large n.
A two-tailed test checks whether the proportion differs from p₀ in either direction. A one-tailed test checks for deviation in only one direction — left-tailed tests if the proportion is less than p₀, right-tailed tests if it is greater. Choose based on your research question before seeing the data. One-tailed tests have more power in the specified direction but cannot detect effects in the opposite direction.
Because the binomial distribution is discrete, the actual Type I error rate is typically below the nominal α — the test is conservative. For example, with n = 10 and p₀ = 0.5, the possible two-tailed p-values are discretely spaced. This discreteness means the test may struggle to achieve exactly 0.05 significance, making it harder to reject H₀ even when effects are real. The mid-p value variant partially addresses this conservatism.
If the p-value equals 0.05 exactly, the result is statistically significant at the α = 0.05 threshold — but just barely. Many statisticians recommend treating borderline p-values (0.01-0.05) with caution. Consider the practical significance of the effect size, the cost of Type I and Type II errors, and whether the sample size was adequate before making definitive conclusions based on a borderline p-value.
Yes, the exact binomial test works for any n ≥ 1. However, with very small samples, statistical power is extremely limited — you may be unable to reject the null hypothesis even when the true proportion deviates substantially from p₀. For n = 5 and p₀ = 0.5, even 5 successes out of 5 trials produces p ≈ 0.062 (two-tailed), which is not significant at α = 0.05.

Sources & References

Last updated: 2026-06-06

💡

Help us improve!

How would you rate the Binomial Test Calculator?

<>

Editorial Note

MyCalcBuddy Editorial Team

This page is maintained as an educational calculator reference.

Source

Formula Source: Standard Mathematical References

by Various

UpdatedLast reviewed: May 2026
CheckedFormula checks are based on standard references and internal QA review.