Confidence Interval for a Proportion Calculator (Free)

StatisticsFreeNo sign-up

A confidence interval for a proportion calculator turns x successes out of n into a range for the true proportion. The textbook (Wald) formula is p̂ ± z*√(p̂(1 − p̂)/n): for 40 successes in 100 trials, p̂ = 0.4, the standard error is 0.049, and the 95% interval is 0.4 ± 0.096, or 0.304 to 0.496. The more accurate Wilson interval is 0.3094 to 0.4980.

Confidence interval for a proportion
Enter the sample as
Try:
%
95% Wilson score interval for p
0.3094 to 0.498

As percentages: 30.94% to 49.8%. Sample proportion p̂ = 40/100 = 0.4 (40%).
Sample proportion p̂0.4
Critical value z*1.96
Standard error (Wald)0.049
Margin of error (Wald)± 0.096
Wald (textbook) interval0.304 to 0.496
Successes, failures40, 60
What this means
We are 95% confident that the population proportion p is between 0.3094 and 0.498 (30.94% to 49.8%), based on 40 successes in 100 trials.
All five methods side by side
Method Lower Upper Width
Wald (normal approximation) 0.304 0.496 0.192
Wilson score 0.3094 0.498 0.1886
Agresti–Coull 0.3093 0.4981 0.1887
Jeffreys 0.308 0.4977 0.1898
Clopper–Pearson exact 0.3033 0.5028 0.1995
Wilson and Jeffreys are recommended for most samples; Clopper–Pearson guarantees at least 95% coverage and is the widest; Agresti–Coull is close to Wilson for larger n.
Intervals by method

Interval chart by method. Wald (normal approximation) from 0.304 to 0.496; Wilson score from 0.3094 to 0.498; Agresti–Coull from 0.3093 to 0.4981; Jeffreys from 0.308 to 0.4977; Clopper–Pearson exact from 0.3033 to 0.5028.0.30.40.5WaldWilsonAgresti–CoullJeffreysClopper–Pearson

headline methodp̂ = 0.4
Dots mark each interval’s center. Wilson and Agresti–Coull pull the center toward 0.5, which is why they behave better near 0 and 1.
Show steps
  1. Sample proportion: p̂ = x / n = 40 / 100 = 0.4. Confidence level 95%, so α = 0.05 and z* = z(α/2) = 1.96.
  2. Wald (textbook): SE = √(p̂(1 − p̂)/n) = √(0.4 × 0.6 / 100) = 0.049; ME = z* × SE = 1.96 × 0.049 = 0.096; interval 0.4 ± 0.096 = 0.304 to 0.496.
  3. Wilson score: center = (p̂ + z²/(2n)) / (1 + z²/n) = (0.4 + 0.019207) / 1.038415 = 0.4037; half-width = z√(p̂(1 − p̂)/n + z²/(4n²)) / (1 + z²/n) = 0.0943; interval 0.3094 to 0.498.
  4. Check the textbook condition: np̂ = 40 and n(1 − p̂) = 60. Both are at least 10, so the Wald interval is acceptable, although Wilson is still more accurate.
  5. Conclusion: We are 95% confident that the population proportion p is between 0.3094 and 0.498 (30.94% to 49.8%), based on 40 successes in 100 trials.

Confidence Interval for a Proportion Calculator (Free)
Embed this calculator on your site

Free to use on class pages, blogs and course pages. Copy the code below and paste it into your page:

How to use the confidence interval for a proportion calculator

  1. Choose One proportion for a single sample, or Two proportions to compare two groups (for example a treatment group and a control group).
  2. Enter the number of successes x and the sample size n. If you only have a percentage, switch to Proportion p̂ and type 0.4 or 40%; the calculator converts it back to a count.
  3. Type any confidence level (90%, 95% and 99% are one tap away) and pick the headline method. Wilson is the default; Wald matches most textbooks.
  4. Read the interval, then compare all methods in the table and chart. Show steps gives the full working for the Wald interval and for your headline method.

The formula for a confidence interval for a proportion

Write p̂ = x/n for the sample proportion and z* for the normal critical value that leaves (1 − C)/2 in each tail: 1.645 for 90%, 1.960 for 95% and 2.576 for 99%.

  • Wald (normal approximation): p̂ ± z*√(p̂(1 − p̂)/n). Simple and taught everywhere, but its coverage can be well below the stated level.
  • Wilson score: center (p̂ + z²/(2n)) / (1 + z²/n), half-width z√(p̂(1 − p̂)/n + z²/(4n²)) / (1 + z²/n). It never leaves the range 0 to 1.
  • Agresti–Coull: add z²/2 successes and z²/2 failures (about 2 and 2 at 95%), so ñ = n + z² and p̃ = (x + z²/2)/ñ, then use the Wald formula with p̃ and ñ.
  • Clopper–Pearson exact: the limits are the values of p for which getting x or more (lower limit) or x or fewer (upper limit) successes has probability (1 − C)/2. They come from beta-distribution quantiles.
  • Jeffreys: the (1 − C)/2 and (1 + C)/2 quantiles of the Beta(x + ½, n − x + ½) distribution.

When the Wald interval fails, and which method to use

The Wald interval treats p̂ as if it were the true proportion when it estimates the standard error. That works when the sample is large and p is not near 0 or 1. It breaks down in three ways you can see in this calculator:

  • Zero successes or zero failures. With 0 of 30, the standard error is 0 and the Wald interval is the single point 0, which claims certainty from 30 observations.
  • Limits outside 0 to 1. With 3 of 25, the Wald lower limit is 0.12 − 0.1274 = −0.0074, an impossible proportion. The NIST handbook calls an approach that produces impossible values “inferior”.
  • Poor coverage even with large n. Brown, Cai and DasGupta (2001) showed that the actual coverage of the nominal 95% Wald interval swings erratically and can fall far below 95% for some combinations of n and p, not only for small samples.

Practical guidance from those sources: use Wilson (NIST’s recommended method and the default here) or Jeffreys for most work, especially when n is 40 or less; Agresti–Coull is a simple, slightly wider alternative for larger samples; use Clopper–Pearson when you must guarantee at least the stated coverage, accepting a wider interval. If your course requires the Wald interval, check that there are at least 10 successes and 10 failures (np̂ ≥ 10 and n(1 − p̂) ≥ 10); the calculator checks this for you.

Worked examples

40 successes in 100 trials

p̂ = 0.4. Wald: SE = √(0.4 × 0.6/100) = 0.0490, ME = 1.96 × 0.0490 = 0.0960, interval 0.3040 to 0.4960. Wilson: z²/n = 0.0384, center = (0.4 + 0.0192)/1.0384 = 0.4037, half-width 0.0943, interval 0.3094 to 0.4980. With 40 successes and 60 failures all methods agree to about 0.01.

A small sample: 3 of 25

p̂ = 0.12, and only 3 successes, so the success-failure check fails. Wald gives −0.0074 to 0.2474 (cut to 0 to 0.2474). Wilson gives 0.0417 to 0.2996 and the exact interval 0.0255 to 0.3122. The Wald interval is both impossible at the bottom and too short at the top.

Difference of two proportions

Group 1 has 56 successes out of 70 (p̂₁ = 0.8) and group 2 has 48 out of 80 (p̂₂ = 0.6), so the difference is 0.2. The Wald standard error is √(0.8 × 0.2/70 + 0.6 × 0.4/80) = 0.0727, giving 0.0575 to 0.3425. Newcombe’s hybrid score method, built from the two Wilson intervals (0.6918 to 0.8770 and 0.4905 to 0.7004), gives 0.0524 to 0.3339; Agresti–Caffo, which adds one success and one failure to each group, gives 0.0525 to 0.3358. All three exclude 0, so group 1’s rate is higher at the 5% level.

Comparison of methods at 95%

Sample Method 95% interval
40 of 100 Wald 0.3040 to 0.4960
Wilson score 0.3094 to 0.4980
Agresti–Coull 0.3093 to 0.4981
Jeffreys 0.3080 to 0.4977
Clopper–Pearson exact 0.3033 to 0.5028
3 of 25 Wald 0.0000 to 0.2474
Wilson score 0.0417 to 0.2996
Agresti–Coull 0.0333 to 0.3079
Jeffreys 0.0350 to 0.2867
Clopper–Pearson exact 0.0255 to 0.3122
0 of 30 Wald 0.0000 to 0.0000
Wilson score 0.0000 to 0.1135
Agresti–Coull 0.0000 to 0.1347
Jeffreys 0.0000 to 0.0797
Clopper–Pearson exact 0.0000 to 0.1157

Wald limits outside 0 to 1 are shown cut at the boundary. Notice how the methods agree for 40 of 100 and disagree sharply for 0 of 30.

Common mistakes

Mistake What to do instead
Using a percentage (40) in the formula Use the proportion 0.4, or switch the input to Proportion
Using the Wald interval with 0 successes Use Wilson, Jeffreys or the exact interval
Reporting a negative lower limit A proportion cannot be negative; use Wilson, which stays in 0 to 1
Using t* instead of z* Proportion intervals use the normal critical value
Adding the two separate intervals to compare groups Build one interval for p₁ − p₂

Checking homework with the calculator

Most textbooks ask for the Wald interval. Set the headline method to Wald, work the steps by hand (p̂, SE, z*, margin of error, both ends), then compare with Show steps. If your answer differs in the third decimal, the usual cause is a rounded SE. Then look at the Wilson row: if it differs a lot from Wald, mention that the normal approximation is weak for your data.

Confidence intervals for proportions practice quiz: 10 questions

Test yourself with 10 multiple-choice questions. Choose an answer and press Submit to see if you are right and why. Your score appears at the end.

Question 1 of 10
1. In a sample of 200, 50 say yes. What is the sample proportion p̂?

Found a mistake? Let us know!

2. For p̂ = 0.5 and n = 100, what is the Wald standard error?

Found a mistake? Let us know!

3. For p̂ = 0.5 and n = 100, what is the 95% Wald confidence interval?

Found a mistake? Let us know!

4. Which sample fails the textbook check for using the Wald interval?

Found a mistake? Let us know!

5. A sample has 0 successes in 50 trials. What does the Wald interval give?

Found a mistake? Let us know!

6. Using the rule of three, about what is the upper 95% limit when 0 of 150 items fail?

Found a mistake? Let us know!

7. Roughly what does the Agresti–Coull method do at 95% confidence?

Found a mistake? Let us know!

8. Which method guarantees at least the stated coverage, at the cost of a wider interval?

Found a mistake? Let us know!

9. Group 1: 30 of 100. Group 2: 20 of 100. What is the Wald standard error of p̂₁ − p̂₂?

Found a mistake? Let us know!

10. A 95% interval for p₁ − p₂ is 0.03 to 0.17. What can you conclude?

Found a mistake? Let us know!

Frequently asked questions

What is a confidence interval for a population proportion?

It is a range of plausible values for the true proportion p in the population, built from a sample. A 95% interval comes from a method that captures the true p in about 95% of samples, if that method’s coverage holds.

How do you calculate a confidence interval for a proportion?

Find p̂ = x/n, the standard error √(p̂(1 − p̂)/n) and the margin of error z* × SE, then subtract it from and add it to p̂. For 520 “yes” answers out of 1,000: p̂ = 0.52, SE = 0.0158, ME = 0.031, so the 95% interval is 0.489 to 0.551.

What is the formula for a confidence interval for a proportion?

The textbook formula is p̂ ± z*√(p̂(1 − p̂)/n), with z* = 1.96 for 95%. It is reliable only with at least 10 successes and 10 failures; the Wilson formula above works for any sample.

Is a confidence interval a proportion?

No. The sample proportion p̂ is a single number; the confidence interval is a range around it. Its width depends on the sample size, on p̂ and on the confidence level.

How do you find a confidence interval for two proportions?

Use the Two proportions tab. The textbook formula is (p̂₁ − p̂₂) ± z*√(p̂₁(1 − p̂₁)/n₁ + p̂₂(1 − p̂₂)/n₂); Newcombe’s method is more accurate for small groups. If the interval does not contain 0, the two proportions differ significantly.

Sources

Related calculators

More statistics calculators

Browse all 541 calculators

Related to This Article

What people say about "Confidence Interval for a Proportion Calculator: 5 Methods"?

No one replied yet.

Leave a Reply