Compute P(X = k), P(X ≤ k), P(X ≥ k), and between-bounds probabilities, run an exact one-sample binomial test, and build a 95% confidence interval for a proportion using Clopper-Pearson, Wilson, Agresti-Coull, or Wald. Reproducible R, Python, and APA output.
Total Bernoulli trials. Integer ≥ 1.
Probability of a success on a single trial, 0 ≤ p ≤ 1.
The binomial distribution counts the number of successes in n independent Bernoulli trials, each with success probability p. Jacob Bernoulli derived its algebra in Ars Conjectandi (published posthumously in 1713) and also proved the law of large numbers in the same volume. Abraham de Moivre (1733) and Pierre-Simon Laplace (1812) showed that for large n the binomial converges to a normal with mean np and variance np(1 − p), establishing the foundation of all normal-approximation inference for proportions. The probability mass function P(X = k) = C(n, k) p^k (1 − p)^(n − k) is the canonical model for count-of-success data: responders in a trial, heads in coin flips, defective items in a batch, correct answers on a multiple-choice quiz.
Picking which probability you want hinges on the question. P(X = k) gives the chance of an exact value and is the building block of every other binomial probability. P(X ≤ k) is the lower-tail CDF and answers at-most questions. P(X ≥ k) is the upper-tail survival probability and is the standard one-sided p-value when you want to know how unusual an observation is. The between form P(a ≤ X ≤ b) covers range questions like "what is the probability of 4 to 6 successes in 10 attempts." The calculator's probability tab exposes all six query types so you can answer any of these without reaching for a separate formula.
When you observe k successes in n trials and want to test whether the true success probability differs from a null value p0, the exact binomial test is the gold standard. Its two-sided version follows R's binom.test convention: sum the probability mass over every outcome with probability no greater than the observed, the "doubled-tail" method introduced by Yates and adopted by Sterne (1954). For one-sided tests the p-value is simply the upper or lower tail of the CDF. The exact test is exact in the sense that its p-value is computed directly from the binomial PMF rather than from a chi-square or normal approximation, so it remains valid for any n and p, including the small-sample, extreme-p regimes where the chi-square and Wald tests fail.
For a confidence interval on a proportion there are four standard methods, each with a different trade-off between simplicity, coverage, and bound behavior. Wald, the normal-approximation interval p̂ ± z × √(p̂(1 − p̂) / n), is the simplest and the one most introductory texts teach, but it has erratic coverage and can extend below 0 or above 1, so modern guidance (Agresti and Coull 1998, Newcombe 1998, Brown, Cai, and DasGupta 2001) is to avoid it. Wilson (1927) inverts the score test and has excellent coverage for any n and p. Agresti-Coull (1998) is the "add 2 successes and 2 failures" shortcut to Wilson and is the default in many modern style guides. Clopper-Pearson (1934) inverts the exact binomial test and guarantees ≥ 95% coverage at the cost of being slightly conservative (its intervals are wider than Wilson or Agresti-Coull). The calculator returns all four so you can pick by audience: Clopper-Pearson for regulatory submissions and guideline panels, Wilson or Agresti-Coull for journal articles, Wald only when required for backward compatibility.
Binomial results feed directly into downstream analyses. To combine many binomial outcomes into a single pooled proportion across studies, use the proportion meta-analysis calculator. To translate a binomial test statistic into a confidence interval (or vice versa) for any distribution, use the p-value to CI converter. To compare two independent proportions in a 2×2 table, use the chi-square calculator. To plan sample size for a single-proportion study, use the sample size calculator. For data extraction, exact-test reporting, and APA-formatted manuscripts from a PhD statistician, our statistical analysis service handles everything end-to-end.
Probability for any P(X = k), P(X ≤ k), P(X ≥ k), or between-bounds query; one-sample test for an exact binomial test and four CIs; table for the full PMF, CDF, and survival side by side.
n trials and p success probability on the probability tab; k observed successes, n trials, and p0 null on the test tab; n and p on the table tab.
= for exact, ≤ for at-most, ≥ for at-least, between for a range. On the test tab, pick two-sided, less, or greater.
Probability returns the requested probability plus mean, variance, SD, and a normal-approximation validity check. Test returns the exact p-value with Clopper-Pearson, Wilson, Agresti-Coull, and Wald 95% CIs.
Reproducible code snippets paste straight into RStudio or Jupyter and use dbinom/pbinom in R or scipy.stats.binom in Python. APA text uses italicized statistic letters and the conventional p < .001 truncation.
Next step
A PhD statistician handles exact tests at any n, Bayesian posterior intervals, sample-size planning for one and two proportions, and a publication-ready APA results section.
Our promise: Free re-run and re-write if reviewers question the analysis or reporting.
Timeline
Most projects deliver in under 2 weeks. We confirm an exact date in your quote.
If reviewers push back
If reviewers question the analysis, assumptions, or reporting, we re-run and re-write free.
Confidentiality
NDA available on request before any project discussion. Your data, study design, and manuscript stay private either way.
Want a PhD methodologist to handle the whole project?
Get a complete proportion and binary-outcome analysis with exact tests, Bayesian posterior intervals, sample-size planning, and APA-formatted reporting by a PhD statistician. Free re-run and re-write if reviewers question the analysis or reporting. Pay only after you approve your quote.
P(X = k) = C(n, k) p^k (1 − p)^(n − k)
Chance of exactly k successes in n independent Bernoulli trials. C(n, k) = n! / (k!(n − k)!) is the binomial coefficient. Implemented in R as dbinom(k, n, p) and in Python as scipy.stats.binom.pmf(k, n, p).
P(X ≤ k) = Σ P(X = j) for j = 0..k
At-most CDF. Survival probability P(X ≥ k) = 1 − P(X ≤ k − 1). R: pbinom(k, n, p) for lower tail, pbinom(k − 1, n, p, lower.tail = FALSE) for upper tail.
E[X] = np Var[X] = np(1 − p)
Mean and variance of the binomial. SD is √(np(1 − p)). Variance is maximized at p = 0.5 (the conservative worst case for sample-size planning when p is unknown). Mode equals ⌊(n + 1)p⌋.
X ≈ Normal(np, np(1 − p)) if np ≥ 5 and n(1 − p) ≥ 5
Large-n limit. Standardize with z = (k − np) / √(np(1 − p)) and read off the normal CDF. With continuity correction, use k ± 0.5 to match the discrete binomial more closely.
Beta quantiles: L = B(α/2; k, n − k + 1), U = B(1 − α/2; k + 1, n − k)
Inversion of the exact binomial test (Clopper & Pearson 1934). Guaranteed ≥ 95% coverage. Slightly conservative (wider than Wilson and Agresti-Coull). The default for regulatory submissions and guideline panels.
Wilson: (p̂ + z²/2n) / (1 + z²/n) ± z √(p̂(1−p̂)/n + z²/4n²) / (1 + z²/n)
Wilson (1927) inverts the score test; coverage is excellent for any n and p. Agresti-Coull (1998) is the simple 'add z²/2 successes and z²/2 failures' shortcut. Modern default for journal articles.
A binomial probability is the chance of observing exactly k successes in n independent Bernoulli trials, each with the same success probability p. The probability mass function is P(X = k) = C(n, k) p^k (1 − p)^(n − k), where C(n, k) is the binomial coefficient. Daniel Bernoulli's uncle Jacob Bernoulli formalized this distribution in Ars Conjectandi (1713), and it remains the canonical model for count-of-success data: heads in coin flips, responders in a clinical trial, defective items in a batch, or correct answers on a multiple-choice test.
Four conditions must hold. First, a fixed number of trials n decided before the data are collected (not driven by the outcomes themselves). Second, each trial has exactly two outcomes ("success" and "failure"). Third, the probability of success p is the same for every trial. Fourth, the trials are independent: the outcome of one does not change the probability of any other. When trials are sampled without replacement from a small finite population, p shifts as the sample grows and the hypergeometric distribution is the correct model; when n is large and p is small with np moderate, the Poisson distribution is the appropriate limit.
The probability mass function PMF returns the probability of a single value: P(X = k). The cumulative distribution function CDF returns the probability of a value at or below a threshold: P(X ≤ k) = Σ P(X = j) for j from 0 to k. Survival function 1 − CDF(k − 1) gives P(X ≥ k). The calculator's table mode shows all three side-by-side so you can pick the right tail at a glance, and the probability tab lets you pick exactly which kind of probability (=, <, ≤, >, ≥, or between two bounds) you want.
Use the exact-equals form P(X = k) when the question is "what is the probability of getting precisely this many successes" (for example, the chance of exactly 7 heads in 10 flips). Use the at-least form P(X ≥ k) when the question is "how unusual is a result this extreme or more" (for example, the p-value of a one-tailed binomial test, or the chance of at least 7 heads). Use P(X ≤ k) for at-most questions, and the between form P(a ≤ X ≤ b) for range questions like "what is the chance of 4 to 6 responders in 10 patients."
The mean is E[X] = n × p, the variance is Var[X] = n × p × (1 − p), and the standard deviation is √(n p (1 − p)). The distribution is symmetric when p = 0.5, right-skewed when p < 0.5, and left-skewed when p > 0.5. The mode is the largest integer k satisfying k ≤ (n + 1)p. The variance is maximized at p = 0.5 (where it equals n/4), which is why surveys with unknown p often plan for the conservative worst case at p = 0.5 when computing sample size.
The De Moivre-Laplace theorem says that for large n the binomial distribution approaches a normal with mean np and variance np(1 − p). A common rule of thumb is that the approximation is reasonable when both np ≥ 5 and n(1 − p) ≥ 5, with Cochran's stricter version requiring both to exceed 10 or even 15 for inferential work. The calculator reports whether the rule is satisfied and shows both the exact binomial result and the normal approximation when the rule passes. For small samples or extreme p, use the exact binomial test and Clopper-Pearson CI instead of the normal Wald form.
The exact binomial test computes a p-value directly from the binomial PMF rather than relying on a normal approximation. For the two-tailed version against H0: p = p0, the calculator follows R's binom.test convention: sum the PMF over all outcomes whose probability is no greater than the observed value (the "doubled-tail" method). One-tailed versions sum the PMF in one direction. The exact test is the gold standard for small samples or extreme p, where the chi-square and z approximations break down.
All four bound a proportion. Wald uses the normal-approximation formula p̂ ± z × √(p̂(1 − p̂) / n) and is the worst choice for small n or p near 0 or 1; it can extend below 0 or above 1 and has poor coverage. Wilson (1927) inverts the score test and has excellent coverage even for small samples. Agresti-Coull (1998) is the simple "add 2 successes and 2 failures" variant of Wilson and is the modern default for most journal style guides. Clopper-Pearson (1934) inverts the exact binomial test and is guaranteed to have ≥ 95% coverage (conservative). The calculator reports all four so you can choose by audience and assumption.
If you want to estimate a proportion to within a margin of error E with confidence 1 − α, the conservative sample size formula is n = (z_{α/2})² × p(1 − p) / E². Using p = 0.5 gives the maximum-variance worst case: n ≈ (1.96)² × 0.25 / E² ≈ 0.9604 / E². For a 5% margin, that is 385; for 3%, that is 1,068; for 1%, that is 9,604. For a one-sample test of a proportion against a specified value, use the sample size calculator with the appropriate effect size (Cohen's h is standard).
Binomial: fixed n, independent trials, constant p, covering most clinical-trial response counts. Poisson: counts per unit time or space with rate λ, no fixed n, such as emergency-room admissions per hour, defects per square meter, mutations per genome. Hypergeometric: sampling without replacement from a finite population, such as drawing red marbles from a box without putting them back, or the K/N successes in a finite cohort. When n is small relative to a large finite population, the hypergeometric and binomial give nearly identical answers; when np is small with large n, binomial and Poisson agree. The calculator focuses on the binomial; for Poisson and hypergeometric counts use the proportion meta-analysis or chi-square calculator.
To pool many binomial outcomes across studies into a single prevalence or proportion estimate, see the proportion meta-analysis calculator. To convert a binomial test statistic into a 95% confidence interval (or back), see the p-value to CI converter. To compare two independent proportions in a 2×2 contingency table, see the chi-square calculator. To plan the sample size for a one-proportion study, see the sample size calculator. To convert any test statistic (z, t, chi-square, F, r) into a p-value, see the p-value calculator. And for confidence intervals on means and ratio measures rather than proportions, see the confidence interval calculator.
Reviewed by
Dr. Sarah Mitchell holds a PhD in Biostatistics from Johns Hopkins Bloomberg School of Public Health and has over 15 years of experience in systematic review methodology and meta-analysis. She has authored or co-authored 40+ peer-reviewed publications in journals including the Journal of Clinical Epidemiology, BMC Medical Research Methodology, and Research Synthesis Methods. A former Cochrane Review Group statistician and current editorial board member of Systematic Reviews, Dr. Mitchell has supervised 200+ evidence synthesis projects across clinical medicine, public health, and social sciences. She reviews all Research Gold tools to ensure statistical accuracy and compliance with Cochrane Handbook and PRISMA 2020 standards.
We conduct full risk of bias assessments, GRADE evaluations, and complete systematic reviews with rigorous methodology that satisfies peer reviewers. Most projects deliver in under 2 weeks.
Our promise: Free rework on search, screening, or synthesis if reviewers push back.
Will your review include a meta-analysis? Quote my systematic review and meta-analysis
Your project is led by a named PhD methodologist with real credentials and published work.
4.9 / 5 across 1,194+ delivered projects