This calculator runs an exact binomial test, which compares an observed proportion of successes against an expected (hypothesized) proportion p₀. Use it when you have a single binary variable — heads/tails, pass/fail, converted/not — and you want to know whether the success rate differs from a benchmark value. Because it is exact, it is valid even for small samples or extreme proportions, where the normal approximation (z-test) is unreliable. for a quick example.
Summary counts: enter the number of successes, the total number of trials, and the expected proportion p₀ you are testing against (the null hypothesis).
The Binomial Test evaluates whether the proportion of successes in a series of independent yes/no trials differs from a hypothesized value p₀. It computes an exact p-value directly from the binomial distribution rather than relying on a normal approximation, which makes it appropriate for small samples and proportions near 0 or 1.
The probability of observing exactly successes in trials under is:
The two-sided p-value sums the probabilities of all outcomes at least as unlikely as the observed count. The observed proportion and its uncertainty are summarized by the Wilson score confidence interval, and the effect size is reported via Cohen's h:
A coin is flipped 100 times and lands heads 42 times. Is it fair ()?
versus (two-sided).
Summing the binomial probabilities of all outcomes at least as extreme as 42 (in either tail) gives .
The observed proportion is with a 95% Wilson CI of about . Since (and the CI includes 0.5), we fail to reject : there is no significant evidence the coin is unfair.
Note:
# Exact binomial test: 42 successes in 100 trials vs p0 = 0.5
result <- binom.test(x = 42, n = 100, p = 0.5, alternative = "two.sided")
print(result)
# One-sided alternatives:
# binom.test(42, 100, 0.5, alternative = "greater")
# binom.test(42, 100, 0.5, alternative = "less")from scipy.stats import binomtest
# Exact binomial test: 42 successes in 100 trials vs p0 = 0.5
result = binomtest(k=42, n=100, p=0.5, alternative="two-sided")
print(f"p-value: {result.pvalue:.4f}")
print(f"observed proportion: {result.proportion_estimate:.4f}")
# Wilson score confidence interval for the observed proportion
ci = result.proportion_ci(confidence_level=0.95, method="wilson")
print(f"95% CI (Wilson): [{ci.low:.4f}, {ci.high:.4f}]")Whenever the sample is small or the proportion is close to 0 or 1, the normal approximation behind the z-test becomes unreliable. The exact binomial test is always valid and is preferred in those cases.
The Wilson score interval for the observed proportion, which is accurate across a wide range of sample sizes and proportions.
An effect size for the difference between two proportions based on the arcsine transform. As a rough guide, 0.2 is small, 0.5 is medium, and 0.8 is large.