Wilson Score Interval Visualizer
Wilson
Wald
Clopper-Pearson
Keeping the observed proportion fixed at the value you set in the Calculator tab, this shows how the Wilson interval narrows as sample size grows.
Wilson interval width at different sample sizes (fixed p̂)
With n fixed, this plots the Wilson interval bounds for every integer value of x from 0 to n. Notice how the interval is wider near x = n/2 and narrower (but never zero-width) at the boundaries.
Wilson lower and upper bounds for all x/n (shaded region = interval)
With x and n fixed (from the Calculator tab), compare the Wilson interval at four confidence levels simultaneously. Higher confidence levels produce wider intervals.
Wilson intervals at 80%, 90%, 95%, and 99% confidence
Where the Wald Interval Fails
The following four cases show boundary conditions where the Wald interval produces either a zero-width interval or bounds outside [0, 1]. The Wilson interval handles all of them sensibly. Values below use 95% confidence (z ≈ 1.96).
The Wilson Center-Pull Toward 0.5
The Wilson interval is not centered exactly on p̂ = x/n. Its adjusted center is (p̂ + z²/2n) / (1 + z²/n), which is pulled slightly toward 0.5 — most noticeably for small n and extreme proportions. Click any row to see the pull visualized.
n = 20, 95% confidence
What Is the Wilson Score Interval?
The Wilson score interval is a method for constructing a confidence interval around a binomial proportion. Edwin Bidwell Wilson introduced it in 1927 as an alternative to the simpler Wald interval, which is just p̂ ± z√(p̂(1−p̂)/n). While the Wald interval is easy to remember, it can produce zero-width results when all trials succeed or all fail, and it can technically yield bounds below 0 or above 1 — neither of which makes sense for a probability.
The Wilson interval avoids these issues because it is derived differently: by inverting the score test for a binomial proportion rather than by centering on p̂ and adding a symmetric margin. The result is an interval that always stays within [0, 1] and generally has better coverage properties than the Wald interval, particularly when the sample is small or the true proportion is close to 0 or 1.
Wilson Score Interval Formula
Given x successes out of n trials at confidence level 1 − α, let p̂ = x/n and let z be the standard normal critical value for that confidence level. The Wilson interval is:
Formula Breakdown
(p̂ + z²/2n) / (1 + z²/n)This is the midpoint of the Wilson interval. It is not p̂. Adding z²/2n in the numerator and z²/n in the denominator shifts the center slightly toward 0.5. For a large sample the adjustment is negligible; for a small sample with an extreme p̂ it can be substantial.
z√(p̂(1−p̂)/n + z²/(4n²))This term drives the half-width of the interval. It combines the usual binomial variance p̂(1−p̂)/n with an extra z²/(4n²) term that comes from the score-test derivation. The extra term is small for moderate n but prevents the width from collapsing to zero at the boundaries.
1 + z²/nDividing by this quantity scales both the center and the half-width. It is what ensures the final bounds stay within [0, 1].
Wilson vs Wald: A Detailed Comparison
The Wald interval, p̂ ± z√(p̂(1−p̂)/n), is the first confidence interval for a proportion most students encounter. It is straightforward and easy to compute by hand. The Wilson interval requires more arithmetic but offers meaningfully better behavior in many practical situations.
| Property | Wilson | Wald | Clopper-Pearson |
|---|---|---|---|
| Derivation | Score test inversion | Normal approximation to p̂ | Exact binomial (Beta distribution) |
| Center | Adjusted toward 0.5 | Exactly p̂ | Not symmetric — varies |
| Guaranteed within [0, 1] | Yes | No | Yes |
| Boundary behavior (x=0 or x=n) | Sensible | Zero-width | Sensible |
| Small-sample behavior | Generally better | Often unreliable | Conservative |
| Formula complexity | Moderate | Simple | Requires Beta CDF |
| Coverage probability | Close to nominal | Can be below nominal | At or above nominal (conservative) |
Wilson vs Clopper-Pearson
The Clopper-Pearson interval, sometimes called the exact binomial interval, is constructed from the Beta distribution rather than any normal approximation. Because it uses the exact binomial distribution, its actual coverage never falls below the nominal level — but it is described as conservative because actual coverage can substantially exceed the nominal level, producing intervals that are wider than necessary. The Wilson interval is typically narrower than Clopper-Pearson and still has good coverage properties, which is why it is often recommended for practical use. Neither is universally correct; the choice depends on the consequences of undercoverage versus overcoverage in the specific application.
Worked Examples
Example 1: x = 8, n = 20, 95% confidence
p̂ = 8/20 = 0.400z² = 3.8416 | z²/2n = 3.8416/40 = 0.09604 | z²/n = 3.8416/20 = 0.19208p̂ + z²/2n = 0.400 + 0.09604 = 0.49604p̂(1−p̂)/n = 0.4 × 0.6 / 20 = 0.012 | z²/(4n²) = 3.8416/1600 = 0.0024010 | Sum = 0.014401 | √0.014401 ≈ 0.12000z × 0.12000 = 1.960 × 0.12000 = 0.235201 + z²/n = 1.19208Wilson lower = (0.49604 − 0.23520) / 1.19208 = 0.26084 / 1.19208 ≈ 0.2188
Wilson upper = (0.49604 + 0.23520) / 1.19208 = 0.73124 / 1.19208 ≈ 0.6136
Wald: 0.400 ± 1.960 × 0.1095 → [0.1853, 0.6147]
Example 2: x = 1, n = 20, 95% confidence (near zero)
p̂ = 0.05.z²/2n = 0.09604 | numerator center = 0.14604 | p̂(1−p̂)/n = 0.05×0.95/20 = 0.002375 | z²/4n² = 0.0024010 | √(sum) ≈ 0.06828Wilson lower = (0.14604 − 0.13383) / 1.19208 ≈ 0.0102
Wilson upper = (0.14604 + 0.13383) / 1.19208 ≈ 0.2349
Wald: 0.05 ± 1.960 × 0.04873 → [−0.0455, 0.1455] — note the negative lower bound, which is impossible for a proportion.
Example 3: x = 19, n = 20, 95% confidence (near one)
p̂ = 0.95.Wilson lower ≈ 0.7651 | Wilson upper ≈ 0.9898
Wald: 0.95 ± 0.0955 → [0.8545, 1.0455] — the upper bound exceeds 1, which is invalid.
Note the symmetry: the Wilson interval for x = 19, n = 20 mirrors the interval for x = 1, n = 20 reflected around 0.5, i.e. lower(19/20) = 1 − upper(1/20) ≈ 1 − 0.2349 = 0.7651. This is an exact property of the Wilson formula.
Example 4: x = 500, n = 1000, 95% confidence (large sample)
p̂ = 0.500.Wilson lower ≈ 0.4690 | Wilson upper ≈ 0.5310 | Width ≈ 0.0620
Wald lower ≈ 0.4690 | Wald upper ≈ 0.5310 | Width ≈ 0.0620
With a large sample far from the boundaries, Wilson and Wald produce nearly identical results. The practical difference between methods is most apparent in small samples and at extreme proportions.
Statistical Properties of the Wilson Score Interval
A confidence interval's performance is measured primarily by its coverage probability — the frequency with which the interval actually contains the true parameter value across hypothetical repeated samples. An interval is said to have good coverage if this frequency is close to the stated confidence level (e.g., 95%).
| Property | Wilson | Wald | Clopper-Pearson |
|---|---|---|---|
| Coverage probability | Close to nominal for most n, p | Can fall well below nominal for small n or extreme p | Always at or above nominal |
| Width | Moderate; asymmetric near boundaries | Narrow but unreliable at boundaries | Widest of the three (conservative) |
| Symmetry about p̂ | Not generally symmetric | Always symmetric | Not symmetric |
| Boundary x = 0 | Sensible upper bound; lower = 0 | [0, 0] — no uncertainty expressed | Sensible upper bound; lower = 0 |
| Boundary x = n | Sensible lower bound; upper = 1 | [1, 1] — no uncertainty expressed | Sensible lower bound; upper = 1 |
| Derivation | Score test inversion | Normal approximation | Exact Beta-distribution inversion |
Wilson Score Interval Applications
Because the Wilson interval reliably estimates a binomial proportion even with small samples, it appears across many fields where proportions and rates matter.
- A/B testing and conversion rates. Click-through rates and conversion rates are binomial proportions. When a variant has few observations, the Wilson interval gives a more realistic uncertainty range than the Wald interval, preventing over-confidence in early results.
- Survey proportions. Estimating the proportion of respondents who agree with a statement. Wilson intervals perform well even for small subgroup analyses where cell counts can be single digits.
- Classification accuracy. A classifier's accuracy on a held-out test set is a binomial proportion. The Wilson interval quantifies uncertainty around that accuracy estimate.
- Reliability engineering. Estimating the proportion of items that pass a quality test, especially when test batches are small.
- Medical proportions. Estimating response rates in pilot clinical studies where patient numbers are limited.
Wilson Lower Bound for Ranking
One practical application of the Wilson interval is using the lower confidence bound as a conservative ranking score. The idea is that an item with a high observed rate but very few observations may be ranked lower than an item with a slightly lower rate and many observations, because the latter provides stronger evidence.
| Item | Observed rate | Observations | Wilson lower bound (95%) | Rank by lower bound |
|---|---|---|---|---|
| Item A | 95.0% (19/20) | 20 | ≈ 0.765 | 2nd |
| Item B | 90.0% (900/1000) | 1000 | ≈ 0.878 | 1st |
Item A has the higher observed rate (95% vs 90%), but Item B's much larger sample produces a higher Wilson lower bound. Ranking by the lower bound rewards evidence: an item that consistently performs at 90% across 1,000 trials is more reliably ranked above an item that happened to score 95% in 20 trials. Whether this approach is appropriate depends on the specific ranking context and whether a conservative lower bound matches the decision-maker's intent.
Common Mistakes
- Treating [0, 0] as a valid interval. A zero-width Wald interval when x = 0 does not mean the true proportion is certainly zero — it means the Wald method has failed at the boundary. The Wilson interval correctly produces a non-zero upper bound.
- Assuming Wilson is always narrower than Wald. Near x/n = 0.5 and for moderate n, the Wilson and Wald intervals are very similar in width. Wilson is not always more conservative or more liberal than Wald — it simply handles boundary cases correctly.
- Interpreting the interval as a probability statement about the parameter. A 95% confidence interval does not mean "there is a 95% probability the true proportion lies in this interval." The frequentist interpretation is that 95% of intervals constructed this way over repeated sampling would contain the true parameter.
- Rounding intermediate calculations. The formula involves several multiplications and a square root. Rounding p̂ or z before computing the full expression introduces errors. Keep full precision until the final result.
- Confusing the Wilson adjusted center with p̂. The center of the Wilson interval is not x/n. It is pulled toward 0.5 by an amount that depends on z and n.
- Assuming Wilson is always more accurate than Wald or Clopper-Pearson. All three methods have different properties. The right choice depends on the sample size, the true proportion, and the consequences of undercoverage versus overcoverage.
How to Report a Wilson Score Interval
A complete report of a Wilson interval includes the number of successes, the number of trials, the confidence level, and the computed bounds. Avoid reporting only the interval without specifying which method produced it, since Wilson, Wald, and Clopper-Pearson can differ substantially for small samples.
A frequentist interpretation: intervals constructed by this method would contain the true proportion in 95% of repeated experiments. This specific interval is one realization of that procedure. It should not be stated that there is a 95% probability the true proportion is between 0.219 and 0.614.
Related Topics
Sources and further reading:
- Wilson, E.B. (1927). Probable inference, the law of succession, and statistical inference. Journal of the American Statistical Association, 22(158), 209–212. doi:10.2307/2276774
- Brown, L.D., Cai, T.T., & DasGupta, A. (2001). Interval estimation for a binomial proportion. Statistical Science, 16(2), 101–133. doi:10.1214/ss/1009213286
- NIST/SEMATECH e-Handbook of Statistical Methods — Confidence Intervals for a Proportion
- Agresti, A., & Coull, B.A. (1998). Approximate is better than "exact" for interval estimation of binomial proportions. The American Statistician, 52(2), 119–126.
Frequently Asked Questions
The Wilson score interval is a confidence interval for a binomial proportion. Unlike the Wald interval (p̂ ± z√(p̂(1−p̂)/n)), it is derived by inverting the score test rather than centering a normal approximation on p̂. This gives it better behavior near the boundaries p̂ = 0 and p̂ = 1, and it always produces bounds within [0, 1]. It was introduced by Edwin Bidwell Wilson in 1927.
Compute p̂ = x/n and look up the z critical value for your confidence level (z ≈ 1.96 for 95%). Then: lower = [p̂ + z²/(2n) − z√(p̂(1−p̂)/n + z²/(4n²))] / [1 + z²/n] and upper = [p̂ + z²/(2n) + z√(p̂(1−p̂)/n + z²/(4n²))] / [1 + z²/n]. The visualizer on this page does all of this automatically.
With x = 0, n = 20, and 95% confidence: p̂ = 0, z = 1.96. The Wilson upper bound is approximately 0.161 and the lower bound is 0. The Wald interval gives [0, 0], which is a zero-width interval — it conveys no uncertainty at all. The Wilson interval correctly shows that the true proportion could be as large as about 0.161, given that we observed zero successes in only 20 trials.
The Wald interval is symmetric around p̂ by construction. The Wilson interval's adjusted center is (p̂ + z²/2n) / (1 + z²/n), which is pulled toward 0.5 relative to p̂. This pull comes directly from the score-test derivation and is what allows the interval to stay within [0, 1] even at the boundaries. For large n the adjustment is tiny; for small n with extreme p̂ it can be noticeable.
No. The mathematical structure of the Wilson formula guarantees that both bounds lie within [0, 1]. This is one of its key advantages over the Wald interval, which can produce a negative lower bound or an upper bound greater than 1 when p̂ is close to 0 or 1 respectively.
The Wald interval is simply p̂ ± z√(p̂(1−p̂)/n) — a symmetric normal approximation centered on the observed proportion. The Wilson interval is derived from the score test and has an adjusted center and a different half-width formula. The practical differences: Wald can produce zero-width intervals at x = 0 or x = n, and can exceed [0, 1]; Wilson avoids both problems and generally has better coverage for small samples.
For large samples with proportions away from the boundaries, the two methods give nearly identical results. The Wilson interval has a genuine practical advantage when n is small or when x is near 0 or n. It does not "always" produce better results in a universal mathematical sense — both are approximations and neither achieves exact coverage for all n and p simultaneously.
The Clopper-Pearson interval uses the exact binomial distribution (via the Beta distribution) rather than any normal approximation. Its actual coverage probability never falls below the nominal level, but this conservative property comes at a cost: the interval is typically wider than necessary. The Wilson interval is a score-based approximation that has good but not guaranteed coverage, and it tends to be narrower than Clopper-Pearson while still being substantially better than Wald near the boundaries.
Larger samples produce narrower Wilson intervals, all else equal. For a fixed p̂ = 0.5 at 95% confidence: n = 10 gives a width of about 0.574, n = 50 gives about 0.268, n = 100 gives about 0.192, and n = 1000 gives about 0.062. Use the Sample Size tab in the visualizer above to see this progression interactively.
Higher confidence levels require a larger z critical value, which increases the half-width term z√(...). A 99% Wilson interval is wider than a 95% interval for the same x and n, reflecting the tradeoff between confidence and precision. The Confidence Levels tab in the visualizer shows all four common levels simultaneously.
The Wilson interval estimates uncertainty around a single proportion. In A/B testing you typically compare two proportions (conversion rates for variant A and variant B). You can compute Wilson intervals for each variant separately to visualize their individual uncertainty, but a formal test of whether the two proportions differ requires a two-proportion hypothesis test or a specific A/B testing methodology. Our A/B Test Calculator handles this comparison directly.
Wilson lower bound ranking uses the lower confidence bound as a ranking score instead of the raw observed proportion. An item with 90% success in 1,000 trials ranks above one with 95% success in 10 trials because the lower Wilson bound for the 1,000-trial item (≈ 0.878) exceeds the lower bound for the 10-trial item (≈ 0.720). This rewards volume of evidence, not just the observed rate. Whether this is appropriate depends on the specific application.
The Wilson interval has an exact symmetry: the lower bound for x successes in n trials equals 1 minus the upper bound for (n − x) successes in n trials. So the interval for x = 19 is the mirror image of the interval for x = 1, reflected around 0.5. This means lower(19/20) = 1 − upper(1/20) ≈ 0.765, and upper(19/20) = 1 − lower(1/20) ≈ 0.990.
x is the number of successes (or events of interest) in n independent Bernoulli trials. Each trial results in either a success (1) or a failure (0). The Wilson interval estimates the unknown true probability of success in any single trial. x must be an integer with 0 ≤ x ≤ n.
If you were to repeat the experiment many times and compute a 95% Wilson interval each time, approximately 95% of those intervals would contain the true population proportion. It is not correct to say "there is a 95% probability that the true proportion lies in this specific interval," because in the frequentist framework the true proportion is a fixed (unknown) value, not a random variable. For a probabilistic statement about the parameter, a Bayesian credible interval is more appropriate.