Your sample
Enter whole numbers. Successes (x) must be between 0 and the sample size (n).
This calculator is for a proportion — a share or percentage of a population. If you have a sample mean and standard deviation instead, use our confidence interval from a mean and standard deviation calculator.
95% confidence interval · Wilson (recommended)
0.241 – 0.367
We are 95% confident that the true proportion lies between 0.241 and 0.367 (24.1% and 36.7%).
Calculation — step by step
A confidence interval for a proportion estimates the true share of a population with a characteristic from a sample. Enter the number of successes (x) and the sample size (n) above, and this calculator returns both the Wald and the Wilson intervals, so you can see the classic estimate next to the more accurate one statisticians recommend.
If you are new to the idea, start with what a confidence interval is — a range of plausible values for an unknown population value, built from your sample. You can also browse all of our statistics calculators.
Proportions or means? This page is for proportions — shares, percentages and rates counted from successes in a sample, such as the share of voters who support a candidate. If your data are a sample mean and a standard deviation, use our confidence interval from a mean and standard deviation calculator instead — that page covers means, not proportions.
How to calculate a confidence interval for a proportion
To build a confidence interval for a proportion by hand, work through these steps. The calculator above does all of them for you, including the validity check at the end.
- Find the sample proportion. Divide the number of successes by the sample size: p̂ = x ÷ n. For example, 60 successes in 200 trials gives p̂ = 0.30.
- Find the standard error. The standard error measures how much p̂ would vary from sample to sample: SE = √(p̂(1 − p̂) ÷ n).
- Pick the critical value z*. It depends only on your confidence level:
| Confidence level | 90% | 95% | 99% |
|---|---|---|---|
| z* (critical value) | 1.645 | 1.960 | 2.576 |
- Find the margin of error. Multiply the critical value by the standard error: ME = z* × SE. A higher confidence level means a larger margin of error and a wider interval.
- Form the Wald interval. Add and subtract the margin of error from p̂: p̂ ± ME.
- Form the Wilson interval. Use the score formula below, which centres the interval slightly differently and keeps it inside 0 to 1.
- Check validity. Make sure np̂ ≥ 5 and n(1 − p̂) ≥ 5. If either fails, trust the Wilson interval, not the Wald interval.
Wald (normal) interval: p̂ ± z*·√(p̂(1 − p̂) ÷ n)
Wilson (score) interval: (p̂ + z²/2n ± z·√(p̂(1 − p̂)/n + z²/4n²)) ÷ (1 + z²/n)
Wald vs Wilson — which interval should you use?
The Wald interval is the one most textbooks teach first: take the sample proportion and add and subtract the margin of error. It is simple, but it has two well-known flaws. First, it can produce limits below 0 or above 1, which are impossible for a proportion. Second, its true coverage is poor when the sample is small or p̂ is close to 0 or 1 — a nominal 95% Wald interval can in reality cover the true value far less than 95% of the time.
The Wilson interval fixes both problems. It is slightly asymmetric, pulls the limits a little towards 0.5, and it can never escape the 0 to 1 range. That is why the NIST/SEMATECH e-Handbook of Statistical Methods uses the Wilson method for its worked proportion example, and why statisticians recommend it as the default.
| Wald (normal) interval | Wilson (score) interval | |
|---|---|---|
| Formula | p̂ ± z*·SE | Score formula (see above) |
| Shape | Always symmetric around p̂ | Slightly asymmetric, pulled towards 0.5 |
| Stays within 0 to 1? | No — it can go below 0 or above 1 | Yes, always |
| Small samples / p̂ near 0 or 1 | Unreliable coverage | Reliable coverage |
| Best for | Quick, large-sample checks | Reporting your result — the recommended default |
Rule of thumb: report the Wilson interval whenever you have a choice, and use the Wald interval only for quick checks on large samples where both np̂ and n(1 − p̂) are comfortably above 10. The calculator above shows both, so you can compare them directly. If you want to test a claim about a proportion rather than estimate it, use our one-proportion z-test calculator.
Worked examples
Example 1 — a typical survey: 60 out of 200
Suppose 60 of 200 surveyed customers say they would recommend a product. Then p̂ = 60 ÷ 200 = 0.30, the standard error is 0.0324 and the 95% margin of error is 0.0635. The Wald interval is 0.236 to 0.364 and the Wilson interval is 0.241 to 0.367. In plain English: we are 95% confident the true share of customers who would recommend the product is between 24.1% and 36.7%.
Example 2 — a proportion near 1: 45 out of 50
Suppose 45 of 50 parts pass inspection: p̂ = 0.90, SE = 0.0424, margin of error = 0.0832. The Wald interval is 0.817 to 0.983, but the Wilson interval is 0.786 to 0.956. Notice how Wilson pulls the upper limit in from 0.983 to 0.956 — it knows a proportion cannot pass 1, and it shrinks the interval towards the middle. Also note that n(1 − p̂) = 5, so validity is borderline and Wilson is the safer report.
Example 3 — a small sample: 5 out of 20
Suppose 5 of 20 patients respond to a treatment: p̂ = 0.25, SE = 0.0968, margin of error = 0.1898. The Wald interval is 0.060 to 0.440 and the Wilson interval is 0.112 to 0.469. Here np̂ = 5 and n(1 − p̂) = 15, so the np ≥ 5 rule is only just met and the calculator shows a borderline-validity warning. With a sample this small, report the Wilson interval (0.112 to 0.469) rather than the Wald interval.
For a fast 68–95–99.7 approximation of an interval instead of an exact calculation, see our empirical rule confidence interval calculator.
When is a confidence interval for a proportion valid?
Both intervals rest on assumptions. Check them before you trust the result:
- Random sampling. The data must come from a random sample (or a randomised experiment). A convenience sample makes the interval meaningless, however wide it is.
- Independence. Observations must be independent, and the sample should be no more than 10% of the population (the 10% condition).
- The success–failure condition. You need at least 5 expected successes and 5 expected failures: np̂ ≥ 5 and n(1 − p̂) ≥ 5. This is the condition that lets the sampling distribution of the sample proportion be approximated by a normal curve — it is what the Wald interval relies on.
If the success–failure condition fails, the Wald interval is not reliable. Report the Wilson interval instead, or collect a larger sample. Some textbooks use a stricter cut-off of 10 rather than 5; the calculator flags anything below 10 as borderline so you can judge for yourself.
Frequently asked questions
What is a confidence interval for a proportion?
A confidence interval for a proportion is a range of plausible values for the true population proportion p, built from a sample. For example, a 95% interval of 0.241 to 0.367 says we are 95% confident the true proportion lies between those values. The interval is centred near the sample proportion p̂, and its width reflects the sample size and the chosen confidence level.
How do you calculate a confidence interval for a proportion?
First find p̂ = x ÷ n and the standard error SE = √(p̂(1 − p̂) ÷ n). For the Wald interval, use p̂ ± z*·SE. For the Wilson interval, use (p̂ + z²/2n ± z·√(p̂(1 − p̂)/n + z²/4n²)) ÷ (1 + z²/n). The calculator above does both, with a step-by-step ledger.
What is p-hat?
P-hat (p̂) is the sample proportion: the number of successes x divided by the sample size n. If 60 of 200 people say yes, p̂ = 60 ÷ 200 = 0.30. It is the point estimate of the unknown population proportion p, and every interval on this page is built around it.
What is the difference between the Wald and Wilson intervals?
The Wald interval is symmetric around p̂ and uses the simple formula p̂ ± z*·SE. The Wilson interval is slightly asymmetric, pulls the limits a little towards 0.5, and always stays within 0 and 1. Wilson has better coverage, especially for small samples and proportions near 0 or 1, so statisticians recommend it as the default.
When should I use the Wilson interval instead of the Wald interval?
Use the Wilson interval whenever accuracy matters, which is almost always: with small samples, with p̂ near 0 or 1, and whenever the Wald interval would run below 0 or above 1. Use the Wald interval only for quick, large-sample checks where np̂ and n(1 − p̂) are both comfortably above 10.
What does the np >= 5 rule mean?
The np >= 5 rule says you need at least 5 expected successes and at least 5 expected failures in your sample — np̂ ≥ 5 and n(1 − p̂) ≥ 5 — before the normal approximation behind the Wald interval is reasonable. For example, with x = 5 and n = 20, np̂ = 5, so the rule is only just met and the result is borderline. Some textbooks use 10 instead of 5 as the safer cut-off.
Can a confidence interval for a proportion go below 0 or above 1?
The Wald interval can: a small sample with p̂ close to 0 or 1 can give limits such as −0.02 or 1.04. A real proportion cannot be below 0 or above 1, so such limits are a sign that the Wald approximation has broken down. The Wilson interval never leaves the 0 to 1 range, which is one reason it is recommended.
What confidence level should I choose: 90%, 95% or 99%?
95% is the standard choice in most reporting. A 90% interval is narrower but less certain; a 99% interval is more certain but wider and less precise. Raising the confidence level always widens the interval, so choose the level your field or brief expects, then let the sample size — not wishful thinking — do the work of narrowing it.
Source: the Wilson method and the worked proportion interval follow the NIST/SEMATECH e-Handbook of Statistical Methods, section 7.2.4.1 “Confidence intervals”, which gives the Wilson interval for a population proportion.
More Tools to Explore
Explore all statistical tools — or jump straight to a related calculator: