Confidence Interval Calculator

Enter how many respondents fell into a group and your total, choose a confidence level, and get the interval the true proportion plausibly lies within. It uses the Wilson score interval, not the textbook Wald formula.

Free, no signup, and everything is calculated in your browser.

55.1% – 64.7%

Observed 60.0% · 95% Wilson interval

This uses the Wilson score interval rather than the textbook Wald formula. Wald misbehaves near 0% and 100% and at small samples — it can even produce a bound below zero.

Why this uses Wilson, not Wald

Most calculators use the Wald interval: p ± z√(p(1−p)/n). It's the one in textbooks, and it breaks in exactly the cases people care about — small samples and results near 0% or 100%, where it can produce a lower bound below zero.

This uses the Wilson score interval, which is the standard recommendation and stays inside 0–100% by construction. At large samples with a mid-range result the two agree closely; at the edges Wilson is right and Wald isn't.

How to calculate a confidence interval for a proportion

A proportion is a count out of a total: 240 of 400 respondents said yes, so p̂ = 0.60. The confidence interval gives the range of true population values consistent with that result at your chosen confidence level. The calculator above works only with proportions like this — yes/no answers, the share choosing an option, the share of top-two-box ratings.

It uses the Wilson score interval. With z from the confidence level (1.96 for 95%):

centre = (p̂ + z² ÷ 2n) ÷ (1 + z² ÷ n)

half-width = z × √(p̂(1−p̂) ÷ n + z² ÷ 4n²) ÷ (1 + z² ÷ n)

The interval is centre ± half-width. Compare the Wald interval taught in most introductory courses, p̂ ± z√(p̂(1−p̂) ÷ n), which is also what most margin-of-error calculators use.

Source: Wilson (1927), Probable inference, the law of succession, and statistical inference, JASA

Source: NIST/SEMATECH e-Handbook: Confidence intervals for proportions

Worked example: 240 out of 400

p̂ = 0.60, n = 400, z² = 3.8416. The denominator is 1 + 3.8416 ÷ 400 = 1.0096. The centre is (0.60 + 0.0048) ÷ 1.0096 = 0.5991. Under the square root: 0.24 ÷ 400 + 3.8416 ÷ 640,000 = 0.000606, whose root is 0.02462; times 1.96 and divided by 1.0096 gives a half-width of 0.0478.

Wilson 95% interval: 55.1% to 64.7% — the calculator's default output. The Wald interval is 60% ± 4.8, or 55.2% to 64.8%. With a large sample and a mid-range result, the two methods agree to a tenth of a point. The differences show up elsewhere.

Wilson vs Wald: where the textbook interval breaks

95% intervals. The Wald column shows the raw formula output before any clipping.

ResultObservedWilson (this calculator)Wald (textbook)
240 of 40060%55.1% – 64.7%55.2% – 64.8%
30 of 6050%37.7% – 62.3%37.3% – 62.7%
45 of 5090%78.6% – 95.7%81.7% – 98.3%
19 of 2095%76.4% – 99.1%85.4% – 104.6%
9 of 1090%59.6% – 98.2%71.4% – 108.6%
1 of 156.7%1.2% – 29.8%−6.0% – 19.3%
0 of 200%0% – 16.1%0% – 0% (zero width)

Wald produces impossible bounds above 100% or below 0%, and claims certainty when everyone or no one answers yes. Wilson stays inside 0–100% by construction, and its interval is asymmetric near the edges, as the true uncertainty is.

Sources: Brown, Cai & DasGupta (2001), Interval Estimation for a Binomial Proportion, Statistical Science · Agresti & Coull (1998), Approximate is better than exact for interval estimation of binomial proportions

Why Wilson instead of Wald?

The problem with Wald is not only the impossible bounds. Brown, Cai and DasGupta showed in 2001 that its actual coverage — how often a nominal 95% interval really contains the true value — falls well short of 95%, erratically, even at sample sizes many people consider comfortable. They recommend the Wilson interval (or Agresti–Coull) instead, and the NIST engineering statistics handbook does the same, noting that a method which can produce a negative lower limit is inferior.

The practical rule: if n is in the hundreds and the result is between about 20% and 80%, both methods give the same answer and it does not matter. For small groups, rare events, or near-unanimous results — a subgroup of 15, a 2% complaint rate, 19 of 20 satisfied — use Wilson.

How confidence level changes the interval

Higher confidence means a wider interval, because you are asking the range to catch the true value more often. For 240 of 400: 90% gives 55.9% to 63.9%, 95% gives 55.1% to 64.7%, and 99% gives 53.6% to 66.1%. The data did not change; only how sure you want to be. 95% is the convention in survey reporting.

Sample size has the bigger effect. The interval's width shrinks with the square root of n, so four times the responses gives half the width.

Working backwards: if you want an interval no wider than about ±5 points at 95% confidence, plan for roughly 385 completed responses in the group you will report on, and more for any subgroup. The sample size calculator does this for other targets. Collecting until the interval looks narrow enough and then stopping is not the same thing, because stopping when the result looks good biases it.

Confidence interval for a mean

Averages — a mean rating, average spend, time on task — need a different interval: x̄ ± t × s ÷ √n, where s is the sample standard deviation and t comes from the t-distribution with n − 1 degrees of freedom. This calculator does not do means.

Illustration: 50 respondents give a mean satisfaction rating of 7.2 out of 10 with a standard deviation of 1.8. The standard error is 1.8 ÷ √50 = 0.255; t for 95% and 49 degrees of freedom is 2.010; the half-width is 0.51, so the interval is 6.69 to 7.71.

For rating scales, an alternative that works with this calculator is to report the share of top-box answers (for example, the share rating 9 or 10) as a proportion. Our Likert scale calculator summarises the full distribution.

Source: NIST/SEMATECH e-Handbook: Confidence limits for the mean

How to interpret a confidence interval (and common mistakes)

Strictly, a 95% confidence level describes the method: if you repeated the survey many times, about 95% of the intervals built this way would contain the true value. Any single interval either contains it or does not.

Mistake: treating the interval as the range of answers

An interval of 55% to 65% is about the population share, not about individual respondents. It says nothing about how varied the answers were.

Mistake: reading overlapping intervals as "no difference"

Two groups' intervals can overlap slightly while the difference between them is still statistically clear, because the uncertainty of a difference is smaller than the sum of the two half-widths. Test the difference directly with the A/B test significance calculator.

Mistake: assuming the interval covers every kind of error

It covers random sampling error only. Biased wording, a skewed list, or the people who chose not to answer can move the result outside the interval. AAPOR also notes that sampling-error intervals apply only to probability samples, not opt-in online surveys, so an interval computed from a publicly shared link overstates how much you know.

Source: AAPOR: Margin of Sampling Error / Credibility Interval

Mistake: ignoring a small population

The calculator does not apply a finite population correction. If you surveyed 80 people out of a team of 100, the true uncertainty is much smaller than the interval shown, and at 100 of 100 there is no sampling error at all. The margin of error calculator accepts a population size.

Collecting data for a proportion

A clean proportion needs a clear single-choice question (yes/no, or pick one option) and a known denominator. In Zunoform, responses export to CSV so you can count the group and the total yourself; one response per person stops repeat submissions from inflating either number; and conditional logic lets you ask a follow-up only of the people in the group you care about, without changing the base. Report the count and total alongside the interval ("240 of 400"), so readers can see the sample behind it.

Templates that produce proportions worth an interval

Questions people ask

What does a 95% confidence interval mean?

If you repeated the survey many times, about 95% of the intervals produced would contain the true value. It is not a 95% probability that the true value is in this particular interval, though that reading is common and mostly harmless in practice. It also covers only random sampling error, not biased questions or nonresponse.

Why is my interval so wide?

Small sample. Interval width scales with 1/√n, so quadrupling your responses halves the width — there's no shortcut around collecting more. At 95% confidence, 30 of 60 gives 37.7% to 62.3%, while 240 of 400 gives 55.1% to 64.7%.

What is the difference between the Wilson and Wald intervals?

Wald is the textbook p ± z√(p(1−p)/n). It can run past 0% or 100% and collapses to zero width when every respondent agrees. Edwin Wilson's 1927 score interval stays inside the possible range and keeps closer to its stated coverage at small samples, which is why Brown, Cai and DasGupta and the NIST handbook recommend it. This calculator uses Wilson.

How do I calculate a confidence interval for a proportion by hand?

Divide the count by the total to get p. For a quick Wald estimate, add and subtract 1.96 × √(p(1−p)/n) at 95%. For Wilson, the centre is (p + z²/2n) ÷ (1 + z²/n) and the half-width is z√(p(1−p)/n + z²/4n²) ÷ (1 + z²/n). For 240 of 400 that gives 55.1% to 64.7%.

What if nobody (or everybody) answered yes?

Wilson still gives a useful interval. With 0 of 20, the 95% interval is 0% to 16.1%, meaning the true rate could plausibly be as high as about one in six. The Wald formula would give 0% to 0%, falsely claiming certainty. With 20 of 20, the interval mirrors it: 83.9% to 100%.

What is the difference between a confidence interval and a margin of error?

The margin of error is half the interval's width, quoted as ± points around the estimate. The interval is the full range. With the symmetric Wald method, interval = estimate ± margin. The Wilson interval is not always symmetric around the observed result, so near 0% or 100% it is clearer to quote the two bounds.

Can I use this for an average or a mean rating?

No — it is for proportions (counts out of a total). A mean needs the t-based interval x̄ ± t × s/√n, which uses the standard deviation. Alternatively, convert the rating to a proportion, such as the share of respondents choosing the top two points, and use this calculator on that count.

Related tools

Ready when you are

Better forms.
Better data.

Start with a conversation, a document or a single page.
Unlimited forms and 500 responses per month on Free.
No card required.

  • No credit card
  • Unlimited forms
  • 500 responses / month