ThisCalculator

Everyday

Sample Proportion Confidence Interval: How to Calculate

Updated · Standard formula, shown below

The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.

Sample Proportion Confidence Interval: How to Calculate

A sample proportion confidence interval estimates a population percentage from survey or experiment data, giving a range that likely contains the true value. You enter the number of successes, the sample size, and a confidence level, and the calculator returns the margin of error and the lower and upper bounds of the interval.

Formula

The Wald (normal approximation) confidence interval for a population proportion is:

p̂ ± z* × √(p̂(1 − p̂) / n)

  • p̂ = sample proportion = x / n (number of successes divided by sample size), unitless
  • z* = critical value from the standard normal distribution for the chosen confidence level (1.96 for 95%, 2.576 for 99%, 1.645 for 90%)
  • n = sample size (number of observations), unitless
  • SE = standard error = √(p̂(1 − p̂) / n)

The result is a range: (p̂ − margin of error, p̂ + margin of error). For a 95% confidence level, if you repeated the sampling many times, about 95% of such intervals would contain the true population proportion.

Worked Example

Using the calculator defaults: x = 50 successes, n = 200, confidence level = 95%.

  1. Compute the sample proportion: p̂ = 50 / 200 = 0.25.
  2. Find the standard error: SE = √(0.25 × 0.75 / 200) = √(0.1875 / 200) = √0.0009375 ≈ 0.03062.
  3. Get the critical value for 95% confidence: z* = 1.96.
  4. Margin of error = 1.96 × 0.03062 ≈ 0.0600.
  5. Interval = 0.25 ± 0.0600, so (0.190, 0.310).

We are 95% confident the true population proportion lies between 19.0% and 31.0%.

When to Use a Sample Proportion Interval

Use this interval when you have categorical data (success/failure, yes/no, support/oppose) from a random sample and you want to estimate the proportion in the entire population. Common applications include:

  • Political polls: percentage of voters favoring a candidate
  • Quality control: proportion of defective items in a batch
  • Medical studies: percentage of patients who recover with a treatment
  • Market research: proportion of customers who prefer a product

The interval gives a range of plausible values, which is more informative than a single point estimate because it accounts for sampling variability.

How to Choose the Confidence Level

The confidence level (90%, 95%, 99%) reflects how sure you want to be that the interval contains the true proportion. Higher confidence produces a wider interval. There is a trade-off:

  • 90%: narrower interval, more risk of missing the true value
  • 95%: standard choice for most research
  • 99%: wider interval, used when the cost of being wrong is high

For most purposes, 95% is the default. If you need a specific margin of error, you would instead calculate the required sample size, which depends on the same formula.

Common Mistakes and Misconceptions

One frequent error is misinterpreting the interval: a 95% confidence interval does not mean there is a 95% probability that the true proportion lies within this particular interval. The true proportion is fixed; the interval either contains it or not. The 95% refers to the long-run frequency of intervals that contain the true value across repeated samples.

Another mistake is using the formula when the sample is too small or the proportion is too close to 0 or 1. The normal approximation works poorly when n×p̂ or n×(1−p̂) is less than about 5. In those cases, use an exact method (like the Clopper-Pearson interval) or increase the sample size.

Also, do not confuse the margin of error with the standard error. The margin of error is the standard error multiplied by the critical value (z*). The standard error alone does not define the interval width.

Limits of the Formula

This calculator uses the Wald interval, which is the simplest and most commonly taught method. It assumes:

  • Random sampling from the population
  • Independent observations
  • Large enough sample so the sampling distribution is approximately normal

If the sample is not random, the interval may be biased regardless of size. If the population is small (e.g., less than 10 times the sample size), you should apply a finite population correction: multiply the standard error by √((N−n)/(N−1)), where N is the population size.

For very small samples or extreme proportions, consider the Wilson score interval, which performs better and is recommended by many statisticians. The Wilson interval uses a different formula but can be computed with a more advanced calculator.

Frequently Asked Questions

What is the difference between a sample proportion and a confidence interval?

The sample proportion (p̂) is a single number: the fraction of successes in your sample. A confidence interval is a range of plausible values for the true population proportion, built around p̂ using its standard error and a critical value. The interval accounts for sampling error, so it is more informative than the point estimate alone.

How do I find the z* value for a confidence level?

For 90% confidence, z* = 1.645; for 95%, z* = 1.96; for 99%, z* = 2.576. These come from the standard normal distribution: z* is the value such that the area between −z* and +z* equals the confidence level. You can find them in statistical tables or using the inverse normal function on a calculator.

What if my sample proportion is 0% or 100%?

If p̂ = 0 or 1, the standard error becomes 0, giving a zero-width interval, which is misleading. This happens when you observe no successes or all successes. In such cases, use a different method like the Wilson interval or the rule of three (for 95% confidence, the upper bound is approximately 3/n when p̂ = 0).

Can I use this interval for small sample sizes?

The Wald interval is not reliable when n is small (roughly below 30) or when n×p̂ or n×(1−p̂) is less than 5. For small samples, use an exact binomial confidence interval (like Clopper-Pearson) or the Wilson interval, which gives better coverage.

How does sample size affect the interval width?

Larger samples produce narrower intervals because the standard error decreases with √n. For example, quadrupling the sample size halves the margin of error (assuming p̂ stays the same). To halve the interval width, you need four times the sample size.

What is the margin of error in a poll?

The margin of error is the half-width of the confidence interval, typically reported as ±3% or ±4%. It equals z* × √(p̂(1−p̂)/n). For a 95% confidence level, if a poll shows 52% support with a margin of error of ±3%, the true support is likely between 49% and 55%.

Related

Formula used
in x | Number of successes | - | 50 | 0
in n | Sample size | - | 200 | 1
in cl | Confidence level | % | 95 | 0
out ci | Confidence interval | - | p ± z*sqrt(p*(1-p)/n) | 3
out p | Sample proportion (p̂) | - | x / n | 3
out se | Standard error | - | sqrt(p*(1-p)/n) | 4
out me | Margin of error | - | z*sqrt(p*(1-p)/n) | 3

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.