Confidence Interval for a Mean (Z-Interval)
Use when the population standard deviation σ is known (or n is large enough that the sample standard deviation s is a good estimate). The interval brackets the point estimate x̄ by a margin of error equal to Z standard errors.
CI = x̄ ± Z · σ / √n
Confidence Interval for a Proportion
Wald confidence interval for a population proportion. Used for polls, click-through rates, defect rates, and any other yes/no metric. Requires np̂ and n(1−p̂) both ≥ ~10 for the normal approximation to be reasonable.
CI = p̂ ± Z · √(p̂(1−p̂) / n)
How It Works
A confidence interval pairs a point estimate with a margin of error so the report carries its own uncertainty. The point estimate (x̄ for a mean, p̂ for a proportion) is the best single guess; the margin of error is the Z critical value for your chosen confidence level multiplied by the standard error of the estimate. The Central Limit Theorem says that for large enough n the sampling distribution of the estimate is approximately normal, which is what lets us look up Z = 1.96 for a 95% interval, Z = 2.576 for 99%, and so on from the standard normal table.
Example Problem
A quality team samples n = 30 widgets and measures a mean weight of x̄ = 100 grams. The historical population standard deviation is σ = 15 grams. Compute the 95% confidence interval for the true mean weight.
- Identify the inputs: sample mean x̄ = 100 g, population standard deviation σ = 15 g, sample size n = 30, confidence level 95%.
- Look up the Z critical value for 95% confidence: Z = 1.96 (two-sided, from the standard normal table).
- Compute the standard error: SE = σ / √n = 15 / √30 ≈ 2.7386.
- Compute the margin of error: MoE = Z · SE = 1.96 × 2.7386 ≈ 5.3677.
- Build the interval: CI = x̄ ± MoE = 100 ± 5.3677 = [94.6323, 105.3677].
- Interpret: we are 95% confident that the true mean widget weight lies between 94.63 g and 105.37 g — i.e., the procedure that produced this interval captures the true mean 95% of the time when repeated on fresh samples.
When to Use Each Variable
- CI for a Mean — when the outcome is a numeric measurement — weight, temperature, test score, response time — and you have a sample mean plus either a known σ or a large enough n that s is a reliable stand-in.
- CI for a Proportion — when the outcome is a yes/no event — vote share, conversion rate, defect rate, click-through — and the sample is large enough that np̂ and n(1−p̂) are both at least about 10.
Key Concepts
The 95% in a 95% confidence interval describes the procedure, not the specific interval. If you draw many independent samples and build a 95% CI from each, about 95% of those intervals will contain the true parameter. The one interval you computed either contains it or doesn't — there is no 95% probability attached to that single interval after the data is in. Higher confidence levels (99%, 99.7%) produce wider intervals: you trade precision for the increased chance of bracketing the true value. Larger sample sizes shrink the standard error (SE scales with 1/√n), so doubling precision requires quadrupling the sample.
Applications
- Election polling: reporting a candidate's vote share as 52% ± 3% at 95% confidence translates directly into a CI for a proportion
- Drug efficacy trials: presenting treatment response rates as a CI rather than a single percentage so clinicians can see the precision
- Manufacturing tolerance bands: confirming a process mean stays inside specification by checking whether the spec falls inside the CI
- A/B test reporting: pairing the observed lift with a CI lets product teams distinguish a real effect from a noisy estimate before shipping
- Survey research: reporting margins of error on every published statistic so readers can judge sampling uncertainty at a glance
Common Mistakes
- Saying "there is a 95% probability the true mean is in this interval" — the confidence level is about the procedure across repeated samples, not a probability for the one interval you computed
- Using a Z-interval when σ is unknown and n is small — you should use a t-interval with t* from the t-distribution instead, which is wider to account for the extra uncertainty from estimating σ
- Using a t-interval when σ is genuinely known — the Z-interval is more efficient and is the correct choice in that case
- Applying the Wald proportion interval when np̂ or n(1−p̂) is small — the normal approximation breaks down; prefer Wilson or Clopper–Pearson intervals at the extremes
- Forgetting to halve the tail area — a 95% two-sided interval uses Z = 1.96 (2.5% in each tail), not Z = 1.645 (which is the one-sided 95% value)
Frequently Asked Questions
What is a confidence interval?
A confidence interval is a range of plausible values for an unknown population parameter, paired with a confidence level that describes how often the procedure brackets the truth on repeated samples. A 95% CI for a mean of [94.6, 105.4] means the method used to build that interval captures the true mean about 95% of the time when applied to fresh samples from the same population.
How do you calculate a confidence interval?
For a mean with known σ, compute CI = x̄ ± Z · σ / √n. For a proportion, compute CI = p̂ ± Z · √(p̂(1−p̂)/n). Pick Z from the standard normal table for your chosen confidence level (1.96 for 95%, 2.576 for 99%). The product Z · SE is the margin of error; the interval extends that margin on each side of the point estimate.
What does 95% confidence mean?
It means that if you repeated the entire sampling-and-CI procedure many times, about 95% of the resulting intervals would contain the true population parameter. For a single computed interval, the truth is either inside or outside — the 95% describes the long-run reliability of the method, not the probability for any specific interval.
What is the difference between a Z-interval and a t-interval?
A Z-interval uses the standard normal distribution and is appropriate when the population standard deviation σ is known. A t-interval uses Student's t-distribution and is appropriate when σ is unknown and you estimate it from the sample standard deviation s. The t-interval is slightly wider — especially at small n — to account for the extra uncertainty in estimating σ. As n grows, the two intervals converge.
What is the formula for confidence interval?
The general form is point estimate ± margin of error, where margin of error = critical value × standard error. For a mean with known σ: CI = x̄ ± Z · σ/√n. For a proportion: CI = p̂ ± Z · √(p̂(1−p̂)/n). The critical value Z comes from the standard normal table and depends on the confidence level you choose.
How wide should a confidence interval be?
Width depends on three things: the confidence level (higher confidence = wider interval), the standard deviation (more variability = wider interval), and the sample size (larger n shrinks the interval via 1/√n). There is no single “right” width — it is a precision-vs-confidence tradeoff you choose for the decision the CI supports. To halve the width at the same confidence level, you must quadruple the sample size.
Why do higher confidence levels produce wider intervals?
Because demanding a higher long-run capture rate requires the interval to cover more of the sampling distribution. The Z multiplier grows from 1.645 (90%) to 1.96 (95%) to 2.576 (99%) to 3.0 (99.7%), and the margin of error scales linearly with Z. You buy more confidence by accepting less precision.
What Z value do I use for a 95% confidence interval?
Use Z = 1.96 for a two-sided 95% confidence interval, which places 2.5% of the area in each tail of the standard normal distribution. Common alternatives: Z = 1.645 for 90%, Z = 2.326 for 98%, and Z = 2.576 for 99%. Use the two-sided value whenever you are reporting an interval on both sides of the estimate.
Confidence Interval Formulas
A confidence interval is a point estimate plus and minus a margin of error — the margin scales with the Z critical value for your chosen confidence level and the standard error of the estimate.
Where:
- x̄ — sample mean (point estimate for the population mean)
- p̂ — sample proportion (point estimate for the population proportion)
- σ — population standard deviation (assumed known for the Z-interval)
- n — sample size (whole number ≥ 2)
- Z — Z critical value for the chosen confidence level (1.96 at 95%, 2.576 at 99%)
- SE — standard error of the estimate (the denominator term)
- MoE — margin of error, equal to Z · SE
Worked Examples
Manufacturing
What is the 95% confidence interval for a sample mean of 100 g with σ = 15 g and n = 30?
A factory samples 30 widgets, finds a mean weight of 100 g, and has a historical σ of 15 g. Build the 95% CI for the true mean.
- SE = σ / √n = 15 / √30 ≈ 2.7386
- Z(95%) = 1.96
- MoE = 1.96 × 2.7386 ≈ 5.3677
- CI = 100 ± 5.3677
CI ≈ [94.6323, 105.3677]
The procedure brackets the true mean about 95% of the time on repeated samples.
Polling
What is the 95% confidence interval for a poll of 400 voters with 50% support?
A pollster surveys 400 voters and finds 50% support a measure. Compute the 95% CI for the true population support proportion.
- SE = √(0.5 × 0.5 / 400) = √(0.25/400) = 0.025
- Z(95%) = 1.96
- MoE = 1.96 × 0.025 = 0.049
- CI = 0.5 ± 0.049
CI = [0.451, 0.549]
Reported in news shorthand: 50% ± 4.9 percentage points at 95% confidence.
Clinical Trial
What is the 99% confidence interval for a response rate of 30% in 200 patients?
A trial of 200 patients shows a 30% response rate. Build the 99% CI for the true response rate.
- SE = √(0.30 × 0.70 / 200) = √(0.21/200) ≈ 0.0324
- Z(99%) = 2.576
- MoE = 2.576 × 0.0324 ≈ 0.0835
- CI = 0.30 ± 0.0835
CI ≈ [0.2165, 0.3835]
Higher confidence (99% vs 95%) widens the interval but increases the long-run capture rate of the true response rate.
Related Calculators
- Z Score Calculator — convert a raw value to a z-score using the same Z table
- Statistics Calculator — compute the mean and standard deviation a CI needs as inputs
- Combinations & Permutations Calculator — count outcomes that drive the n in sampling and probability work
- Percent Error Calculator — measure how far an observed value deviates from an expected one
- Linear Interpolation Calculator — estimate values between known data points
Related Sites
- CameraDOF — Depth of field calculator for photographers
- Percent Off Calculator — Discount and sale price calculator
- Hourly Salaries — Hourly wage to annual salary converter
- InfantChart — Baby and child growth percentile charts
- Dollars Per Hour — Weekly paycheck calculator with overtime
- BOGO Discount — Buy-one-get-one discount calculator