Binomial Test Calculator

Exact test for proportions.

Please enter a valid number of successes (≥0)

Examples

Enter successes, trials, and hypothesized proportion

What Is a Binomial Test?

The binomial test determines whether an observed proportion differs from an expected proportion when outcomes are binary (success/failure). It provides exact probabilities without relying on normal approximation.

Question answered: "Is the success rate different from what we expected?"

Examples:

  • "Is this coin fair?" (50% heads expected)
  • "Is our conversion rate above 5%?"
  • "Did more patients respond to treatment than expected by chance?"

Why "Exact"?

The z-test for proportions approximates the binomial with a normal distribution. This approximation can be poor when:

  • Sample size is small (n < 30)
  • Proportion is extreme (near 0 or 1)
  • Exact p-values are required

The binomial test: Calculates exact probabilities directly from the binomial distribution.

The Binomial Distribution

For n independent trials, each with success probability p:

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

Where C(n,k) = n! / [k!(n-k)!]

This gives the probability of exactly k successes.

How the Test Works

Two-Tailed Test

H₀: p = p₀ H₁: p ≠ p₀

P-value = P(X ≤ observed or X ≥ symmetric extreme | p = p₀)

Sum probabilities of outcomes as extreme or more extreme than observed, in both tails.

One-Tailed Tests

Right-tailed (H₁: p > p₀): P-value = P(X ≥ observed | p = p₀)

Left-tailed (H₁: p < p₀): P-value = P(X ≤ observed | p = p₀)

Example: Testing a Coin

Scenario: 60 heads in 100 flips. Is the coin fair?

Setup:

  • n = 100
  • x = 60 (observed heads)
  • p₀ = 0.5 (expected for fair coin)

Two-tailed p-value: P(X ≤ 40 or X ≥ 60 | p = 0.5)

Using binomial distribution: p-value = 0.057

Conclusion: Marginally non-significant at α = 0.05. The observed 60% heads is not strong enough evidence against a fair coin.

Example: Small Sample

Scenario: 8 successes in 10 trials. Is the success rate above 50%?

Right-tailed test: P(X ≥ 8 | n = 10, p = 0.5) = P(8) + P(9) + P(10) = 0.044 + 0.010 + 0.001 = 0.055

Conclusion: Borderline significant evidence for success rate > 50%.

With z-approximation, this result would be less accurate due to small n.

Comparison with Z-Test

AspectBinomial TestZ-Test
DistributionExact binomialNormal approximation
Sample sizeAnyLarge (np₀ ≥ 10)
Extreme proportionsAccurateMay be inaccurate
ComputationMore intensiveSimple formula
P-valuesExactApproximate

Guideline: Use binomial when np₀ < 10 or n(1-p₀) < 10.

Confidence Intervals

The binomial test can provide exact confidence intervals for p:

Clopper-Pearson interval: Exact, conservative.

These intervals are often asymmetric, reflecting the true uncertainty for proportions near 0 or 1.

Applications

Quality Control

Is defect rate at or below specification?

n = 50 items, 4 defective Is defect rate > 5%?

Medical Diagnosis

Is a diagnostic test's sensitivity different from claimed?

n = 30 positive cases, 27 correctly identified Is sensitivity different from 95%?

A/B Testing (Small Scale)

With limited traffic, exact tests are more reliable.

n = 25 visitors, 5 converted Is rate > 10%?

Genetics

Testing Mendelian inheritance ratios.

Observed 45 dominant : 15 recessive Expected 3:1 ratio (p = 0.75)

Psychology

Sign test for paired comparisons reduces to binomial.

12 of 15 participants improved Is improvement beyond chance (p = 0.5)?

Sports Analytics

Is a player's success rate different from league average?

Player: 28 hits in 90 at-bats League average: 0.275

Sign Test

The sign test is a binomial test on the signs of differences:

Data: Paired observations (before, after)

Count how many differences are positive vs. negative, ignoring ties.

Test: Is P(positive) = 0.5?

If treatment has no effect, positive and negative differences are equally likely.

Mid-P Correction

Standard binomial test can be conservative (exact p rarely equals exactly 0.05).

Mid-P value: Counts half the probability of the observed outcome.

P_mid = P(more extreme) + 0.5 × P(exactly observed)

Less conservative, recommended by some statisticians.

One-Sample vs. Two-Sample

One-sample binomial: Compare proportion to known value (this calculator).

Two-sample comparison: Compare proportions between groups.

Relationship to Other Tests

Chi-Square Goodness-of-Fit

For two categories, chi-square and binomial test address the same question.

Binomial is exact; chi-square is approximate.

Sign Test

The sign test is a binomial test on paired data.

McNemar's Test

For paired binary outcomes, McNemar's test is related to binomial.

Assumptions

Independent Trials

Each trial's outcome is independent of others.

Violated if: outcomes are clustered, same subject measured repeatedly without proper design.

Constant Probability

Success probability p is the same for all trials.

Violated if: conditions change over time, heterogeneous population.

Binary Outcomes

Each trial has exactly two outcomes: success or failure.

If more than two outcomes, use multinomial or chi-square tests.

Common Mistakes

Using Z-Test for Small n

Normal approximation is poor when np < 10. Use exact binomial.

One-Tailed Without Justification

Pre-specify direction based on theory, not after seeing data.

Ignoring Dependence

Clustered data violates independence. Adjust or use different methods.

Misinterpreting P-Value

P = 0.06 doesn't mean 6% chance H₀ is true. It's P(data | H₀ true).

Reporting Results

APA format (exact test):

"An exact binomial test indicated that the observed success rate (80%, 8 of 10) was not significantly different from 50%, p = .109, two-tailed."

For significant result:

"An exact binomial test revealed that the conversion rate (15%, 15 of 100) significantly exceeded the baseline rate of 10%, p = .046, one-tailed, 95% CI [8.6%, 23.5%]."

Power and Sample Size

For planning:

The probability of detecting a true effect depends on:

  • True proportion (p₁)
  • Null proportion (p₀)
  • Sample size (n)
  • Significance level (α)

Use sample size calculator for proportions for planning.

Historical Context

The binomial distribution was developed by Jacob Bernoulli in the late 1600s, published posthumously in 1713.

The exact binomial test became practical with computing power in the mid-20th century. Before computers, normal approximation was necessary for calculations.

Today, exact tests are preferred when feasible, with approximations used for very large samples where exact computation is slow.

Related Calculations

Summary

The binomial test determines whether an observed proportion differs from an expected value by calculating exact probabilities from the binomial distribution. Unlike the z-test approximation, it's valid for any sample size and any proportion. The test sums probabilities of outcomes as extreme or more extreme than observed. Use the binomial test when samples are small, proportions are extreme, or exact p-values are required. Report the observed proportion, sample size, hypothesized value, exact p-value, and confidence interval.