Confidence Interval for Proportion screenshot

Confidence Interval for Proportion

A Wilson score interval for a proportion, with the Wald interval beside it for contrast.

Privacy First
0 Runs
Updated 2026-11-06
No upload
Runs in this tab
No signup

What this page computes

Type the number of successes, the sample size and the level. The page computes the Wilson score interval: centre (p̂ + z²/2n)/(1 + z²/n) and half-width z√(p̂(1 − p̂)/n + z²/4n²)/(1 + z²/n), with z from the inverse normal. It prints the interval, p̂, z*, the half-width, and the Wald interval beside it so the difference is visible. Figures print to six significant figures.

Wilson is used because the Wald interval misbehaves near 0 and 1 and can step outside 0 to 1; the page states that and does not offer Wald as an equal choice. Successes outside 0 to the sample size, and a level outside 0 to 100 percent, are refused.

The arithmetic happens in the browser, so the same counts and level always give the same interval.

The page builds a Wilson score interval for a proportion: 40 successes in 100 trials gives 0.309401 … 0.497997 at 95%, against the Wald interval 0.303982 … 0.496018 printed underneath for contrast. The Wilson form is used because it stays inside 0 … 1 even when the observed proportion is 0 or 1, where the plain Wald interval would run past the bounds a probability cannot leave. Successes must lie between 0 and n, and a sample size of 0 is refused.

Build a Wilson confidence interval for a proportion from a count and a sample size. The Wald interval is shown beside it for contrast.

How to use it

Type the number of successes, the sample size n and the confidence level in percent. Successes run from 0 to n, so a count larger than the sample is refused with both numbers named. The result line gives the Wilson interval and the line under it prints p̂, z* and the half-width, with the Wald interval on its own line so the two forms can be compared directly.

Why Wilson and not Wald

The Wilson interval pulls its centre slightly toward 0.5 and shrinks the half-width in a way that depends on n, which is what keeps it inside 0 … 1 at the extremes; Wald is the plain p̂ ± z*·√(p̂(1 − p̂)/n) and collapses to a zero-width interval when p̂ is 0 or 1. Neither is a posterior probability, and the page says only what the interval is: a range that would contain the true proportion in the stated share of repeated samples.

What to Expect

Best for

  • Reporting a proportion from a survey or a count

What this tool keeps

  • Nothing leaves this tab: the arithmetic runs in the page you are reading, and a reload discards both the input and the result.

Sample output

Wilson 95% CI = 0.309401 … 0.497997 p̂ = 40/100 = 0.4, z* = 1.95996, half-width = 0.0942981 Wald interval, shown for contrast = 0.303982 … 0.496018 the Wilson form is used because it stays inside 0 … 1 at p̂ = 0 or 1

Frequently asked questions

Why is the Wilson interval the one reported?

Because it stays inside 0 … 1 even when every trial succeeds or every trial fails, where the Wald interval would extend past a bound a probability cannot cross. The Wald form is printed on its own line for comparison.

What counts are refused?

A sample size below 1, and successes outside 0 … n. Each refusal names the value and the range it missed.

Is my count uploaded?

No. Both intervals are computed in this page from the three numbers you typed, and nothing is posted to a server or stored.

Developer program

Build custom tools for your store

Join the SDK program to create useful ecommerce utilities for your store.