Free guide · Statistics · Binomial proportionUpdated October 17, 2026

Confidence interval calculator for a proportion

Three of 20 participants responded. Two of 48 had a grade 3 event. None of 30 did. Compare the Wald, Wilson score and Clopper-Pearson intervals for exactly these small counts, see why the textbook Wald interval fails, and learn the zero-event rule of three.

  • Wald, Wilson and exact side by side
  • Small-n worked examples
  • Zero events: the rule of three

Free sandbox · No credit card · 21 CFR Part 11 aligned

Demo: 95% confidence intervals for the same count
WaldWilson scoreClopper-Pearson
3 of 20 (15.0%)−0.6% to 30.6%5.2% to 36.0%3.2% to 37.9%
1 of 50 (2.0%)−1.9% to 5.9%0.4% to 10.5%0.1% to 10.6%
0 of 30 (0.0%)0.0% to 0.0%0.0% to 11.4%0.0% to 11.6%
12 of 40 (30.0%)15.8% to 44.2%18.1% to 45.4%16.6% to 46.5%
The Wald interval goes below zero for 3 of 20 and collapses to a single point for 0 of 30.

The short answer

  • The Wald interval is p ± z√(p(1 − p)/n). It is the textbook formula, and it performs badly for small n and for proportions near 0 or 1: it can go below 0, can collapse to a point, and often covers the true value far less than 95% of the time.
  • The Wilson score interval is (p + z²/2n ± z√(p(1 − p)/n + z²/4n²)) / (1 + z²/n). It never leaves [0, 1], works with zero events and has near-nominal coverage. It is the best default for reporting.
  • The Clopper-Pearson (exact) interval inverts the binomial tail probabilities. It is guaranteed to cover at least 95% of the time, so it is conservative, and it is the usual choice for regulatory tables and small safety samples.
  • Worked example: 3 of 20 responders is 15.0%. Wald gives −0.6% to 30.6%, Wilson 5.2% to 36.0%, Clopper-Pearson 3.2% to 37.9%.
  • Zero events in n participants does not mean a rate of zero. The rule of three says the upper 95% bound is about 3/n: for 0 of 30, about 10%, and the exact two-sided value is 11.6%.

The three methods

Wald, Wilson score and Clopper-Pearson: the formulas

Let x be the number of participants with the event, n the number in the denominator, p = x/n the observed proportion, and z = 1.96 for a 95% interval. The Wald interval treats the sampling distribution of p as normal with variance p(1 − p)/n and returns p ± z √(p(1 − p)/n). It is simple, it is what most introductory courses teach, and it is the default in more spreadsheets than it should be. Its flaw is that the standard error is computed at the observed p. When p is 0 or 1 the standard error is zero, and the interval has no width however small n is.

The Wilson score interval (1927) solves the problem the other way round: it asks which true proportions would not be rejected by a score test given x of n. The result is centre (p + z²/2n) / (1 + z²/n) and half-width z √(p(1 − p)/n + z²/4n²) / (1 + z²/n). It pulls the centre toward 0.5, widens the interval for small n, and stays inside [0, 1] automatically. Brown, Cai and DasGupta (Stat Sci 2001) recommend it, or the Agresti-Coull interval, over Wald for essentially every n.

The Clopper-Pearson interval (1934) is exact. The lower limit is the proportion at which the probability of seeing x or more events is 2.5%, and the upper limit is the one at which the probability of seeing x or fewer is 2.5%. For 3 of 20 that gives 3.2% to 37.9%. With x = 0 the lower limit is 0 and the upper is 1 − 0.025^(1/n); with x = n the upper limit is 1. Because the binomial is discrete, the exact interval is wider than needed on average, with coverage at or above 95% rather than at it. That conservatism is a feature when the cost of understating a risk is high.

Worked examples

Ten counts, three methods, 95% intervals

Computed with the formulas above (Clopper-Pearson by solving the exact binomial tails). Percentages rounded to one decimal; the Wald lower limit is shown negative where it falls below zero.

CountObservedWaldWilsonClopper-Pearson
0 of 100.0%0.0% to 0.0%0.0% to 27.8%0.0% to 30.8%
0 of 300.0%0.0% to 0.0%0.0% to 11.4%0.0% to 11.6%
0 of 1000.0%0.0% to 0.0%0.0% to 3.7%0.0% to 3.6%
1 of 205.0%−4.6% to 14.6%0.9% to 23.6%0.1% to 24.9%
1 of 502.0%−1.9% to 5.9%0.4% to 10.5%0.1% to 10.6%
2 of 484.2%−1.5% to 9.8%1.2% to 14.0%0.5% to 14.3%
3 of 2015.0%−0.6% to 30.6%5.2% to 36.0%3.2% to 37.9%
5 of 1050.0%19.0% to 81.0%23.7% to 76.3%18.7% to 81.3%
12 of 4030.0%15.8% to 44.2%18.1% to 45.4%16.6% to 46.5%
30 of 20015.0%10.1% to 19.9%10.7% to 20.6%10.4% to 20.7%

The three methods agree when n is large and p is moderate (30 of 200). They diverge sharply with small n or p near 0 (the first seven rows). A negative lower limit is impossible and should never appear in a report.

Why Wald fails

Coverage: how often each interval really contains the truth

A 95% interval should contain the true proportion in 95% of repeated studies. That is its coverage, and it can be computed exactly for the binomial by summing the probabilities of the outcomes whose interval contains the true p. For a true rate of 5% with n = 30, the Wald interval has an actual coverage of 78.2%, the Wilson interval 93.9% and the Clopper-Pearson interval 98.4%. For a true rate of 2% with n = 50, Wald covers only 63.5%, Wilson 92.2% and Clopper-Pearson 98.2%. For a moderate rate of 30% with n = 40 the gap closes: 93.0%, 94.4% and 96.1%.

Two things follow. First, Wald is the worst where safety work needs the best: small samples and rare events. The reason is simple: with n = 30 and a true rate of 5%, about a fifth of studies observe zero events, and Wald reports a point with no uncertainty. Second, coverage of every discrete interval wobbles from one n to the next, so one favourable example proves little. The ranking, though, is stable: exact is conservative, Wilson is close to nominal and Wald is anti-conservative for small n or extreme p. A reasonable rule: use Wald only when both the expected events (np) and non-events (n(1 − p)) are at least about 10, and even then Wilson costs nothing extra.

Zero events

The rule of three: the upper limit when nothing was observed

If no events occur in n independent participants, the largest true rate that is still consistent with that result at the 95% level (one-sided) is close to 3/n (Hanley and Lippman-Hand, JAMA 1983). The exact one-sided value solves (1 − p)ⁿ = 0.05.

n participantsRule of three (3/n)Exact one-sided 95% upperExact two-sided 95% upper
1030.0%25.9%30.8%
2015.0%13.9%16.8%
3010.0%9.5%11.6%
605.0%4.9%6.0%
1003.0%3.0%3.6%
3001.0%1.0%1.2%

The rule is accurate from about n = 30 upward. For small n use the exact formula 1 − 0.05^(1/n) (one-sided) or 1 − 0.025^(1/n) (two-sided).

In trials

Adverse event rates, response rates and what to report

The commonest use of these intervals in a clinical trial is a rate with a small denominator: the proportion of participants with a grade 3 or higher event, a response rate in a phase 2 cohort, a dropout rate in a pilot. Take a safety cohort of 48 participants in which 2 had an event: 4.2%, with a 95% Clopper-Pearson interval of 0.5% to 14.3% (Wilson 1.2% to 14.0%). Reporting “4.2%” alone suggests precision the data do not have, and the Wald interval would have given a lower limit of −1.5%. For 0 of 30, the honest statement is “no events were observed; the 95% upper confidence limit for the true rate is 11.6%”. A safety conclusion that 30 uneventful participants prove a rate below 5% is not supported: the data cannot rule out 10%.

Report the method with the interval. Clopper-Pearson is common in safety tables and in single-arm phase 2 reports because it cannot understate the uncertainty, and Wilson is widely used where a tighter, near-nominal interval is wanted. Either way the statistical analysis plan should name the method before the data are seen. For the clinical side of recording and grading events see the adverse event and serious adverse event glossary entries, the adverse event reporting software page and the adverse event eCRF template. Counts like x and n only mean something if the denominator is defined: everyone treated, everyone evaluable, or everyone followed for a minimum time. The interval is only as good as that definition.

These intervals assume independent participants and a single fixed denominator. They do not apply to rates per unit of exposure time, to participants who contribute multiple events, to clustered data (see the cluster-randomised sample size calculator for the design effect), or to time-to-event outcomes where follow-up differs. Planning the sample size for a given interval width is a different calculation: n = z² p(1 − p) / h² for a Wald-type half-width h, so a 10% rate known to within ±5 points needs 139 participants.

Collect the denominator and the events cleanly

Build the eCRFs, visit schedule and randomization in the free sandbox with every feature. No credit card. You pay only when you go live.

Build your study free

In Capture

Getting x and n out of an EDC without disputes

The interval is a one-line calculation once the counts are right, and getting the counts right is the data management work. In Capture, adverse events are recorded on a structured eCRF with onset, severity and seriousness; edit checks raise an auto-query when a site enters an inconsistent value; every change is recorded in the field-level audit trail with the old value, new value, user, time and reason; and the monitoring dashboard shows enrolment against target so the denominator is visible. Data export as CSV or Excel with a data dictionary, or as SDTM datasets in SAS XPT files with Define-XML, so the statistician can compute the counts and intervals in the package of their choice. The two-proportions sample size calculator covers planning a comparison of two rates, and the power analysis calculator states what a given n can detect.

Before you report it

Confidence interval for a proportion: checklist

Define the numerator and denominator

Which events, and which participants (treated, evaluable, followed for a minimum time).

Name the method in the SAP

Wilson or Clopper-Pearson; avoid Wald for small n or extreme rates.

State the confidence level

95% unless the protocol says otherwise; one-sided limits only if pre-specified.

Never report a limit outside 0 to 100%

A negative Wald limit is a sign to change the method.

Treat zero events carefully

Report the upper limit (3/n or exact), not just “0%”.

Check independence

Clustered, repeated or time-varying data need a different method.

Have a statistician confirm

Especially for any regulatory table or a safety statement.

FAQ

Questions teams ask before they switch

Something not covered here? Ask us directly.

Which confidence interval should I use for a proportion?

The Wilson score interval is a good default: it stays within 0 to 100%, handles zero events and has coverage close to 95%. Clopper-Pearson (exact) is conservative and common for regulatory safety tables and small samples. Use Wald only for large n with a moderate proportion, and even then Wilson does as well.

Why does the Wald interval give a negative lower limit?

It is symmetric around the observed proportion and its width comes from p(1 − p)/n evaluated at that proportion. When p is small and n is modest, p − 1.96 × SE falls below zero. For 3 of 20 the Wald interval is −0.6% to 30.6%. A proportion cannot be negative, which is a sign the approximation does not hold.

What is the rule of three?

If no events are seen in n participants, the 95% upper confidence limit for the true rate is approximately 3/n. For 0 of 30 that is about 10%. The exact one-sided value is 9.5% and the exact two-sided Clopper-Pearson limit is 11.6%. It shows that a small clean sample cannot exclude a modest event rate.

How do I get a confidence interval for 0 events?

Use Clopper-Pearson, where the upper limit is 1 − 0.025^(1/n), or Wilson, where it is z²/(n + z²). For 0 of 30 they give 11.6% and 11.4%. Wald gives 0% to 0%, which is wrong.

Is the exact interval always better than Wilson?

It is not better, just more conservative. Clopper-Pearson never covers less than 95%, but because the binomial is discrete it usually covers more, with intervals wider than necessary. Wilson is closer to 95% on average but can dip slightly below for some n and p. Choose by whether you value guaranteed coverage or narrower intervals.

How is this used for adverse event rates?

The rate of participants with an event is a proportion, and the interval shows the uncertainty from a small safety cohort. With 2 of 48 participants affected, the rate is 4.2% with a 95% Clopper-Pearson interval of 0.5% to 14.3%. Define the numerator, the denominator and the method in the analysis plan.

Does this work for rates per patient-year or repeated events?

No. It assumes independent participants each counted once. Rates per unit of exposure need Poisson-based intervals, and repeated events or clustered data need methods that account for the correlation.

Is this a validated calculator?

It is a reference guide, with all numbers computed from the published formulas and the exact binomial. It is not validated software. A statistician should confirm the method and the intervals for any submission.

Get the counts right first

Build the eCRFs, visit schedule and randomization in the free sandbox with every feature. No credit card. You pay only when you go live.

Build your study free