ΣCALCULATORWizard 140+ Calculators

Confidence Interval Calculator

Calculate confidence intervals for means and proportions at 90%, 95%, 99% and custom levels. Includes sample size calculator for a target margin of error.

Load example
Survey, n=50 Test scores Lab result Salary study
95% Confidence Interval
— to —
Mean
Lower bound
Upper bound
Margin of error
Std error
Poll examples
52%, n=1000 35%, n=500 80%, n=200 50%, n=400
95% CI for proportion
Lower bound
Upper bound
Margin of error
Std error
Common targets
Poll ±5% Poll ±3% Precise ±1% Quick ±2%
Minimum sample size needed
Sample size
Margin of error
Confidence
Z-score

What Is a Confidence Interval?

A confidence interval (CI) is a range of values that likely contains the true population parameter. If you calculate a 95% confidence interval from sample data, the interval construction method will capture the true parameter in 95% of repeated samples — not that there is a 95% probability the true value lies in your specific interval. This distinction matters: once calculated, your specific interval either contains the true value or it doesn't. The 95% refers to the long-run success rate of the procedure.

Confidence intervals are far more informative than p-values alone. A p-value tells you whether an effect is statistically significant; a confidence interval tells you the plausible magnitude of that effect. A drug might reduce blood pressure with p = 0.03, but the 95% CI of (-0.2 to 8.4 mmHg) reveals that the true effect could be anywhere from trivial to moderately meaningful. This is why major journals now require confidence intervals alongside p-values in all reported results.

The width of a confidence interval is determined by three factors: sample size (larger n narrows the interval), variability in the data (smaller standard deviation narrows the interval), and confidence level (higher confidence requires a wider interval). Doubling sample size narrows the margin of error by a factor of approximately 1.41 (square root of 2), not by half — which is why the cost of gaining precision grows quadratically.

Z-scores for Common Confidence Levels

Confidence LevelAlpha (α)Z-score (z*)Common Use
90%0.101.645Quick estimates, exploratory research
95%0.051.960Standard in most fields
99%0.012.576Medical, safety-critical research
99.9%0.0013.291High-stakes decisions, quality control

The Formula for a Confidence Interval for a Mean

CI = x̄ ± z* × (s / √n), where x̄ is the sample mean, z* is the z-score for the confidence level, s is the sample standard deviation, and n is the sample size. The term s / √n is the standard error — the standard deviation of the sampling distribution of the mean. The margin of error is z* × SE. For example, with mean = 75, SD = 12, n = 50, and 95% confidence: SE = 12 / √50 = 1.697, margin = 1.96 × 1.697 = 3.33, so the CI is (71.67, 78.33).

💡 Pro Tip — Use t* Instead of z* for Small Samples: When n is less than 30 or the population SD is unknown (almost always), technically you should use the t-distribution critical value (t*) instead of z*. For n = 30 at 95%, t* = 2.042 vs z* = 1.960 — a small but meaningful difference. For n = 10, t* = 2.262 vs z* = 1.960. Our mean calculator uses z-scores for simplicity; for small samples, your result will be slightly narrow and you should use a t-table to look up the exact critical value.

Confidence Intervals in Practice

Election polling provides the most familiar example of confidence intervals. When a poll reports "52% support, with a margin of error of ±3 percentage points," they mean the 95% confidence interval is approximately (49%, 55%). This margin of error calculation uses n = 1,068 respondents (the standard polling sample that achieves ±3% at 95% confidence for a 50/50 split). If you see a poll with only 300 respondents, the margin of error balloons to ±5.7% — far less precise, though often not disclosed clearly.

In clinical medicine, confidence intervals determine whether a new treatment's benefit is clinically meaningful. A drug that reduces hospital stay by 0.5 days (95% CI: 0.1 to 0.9 days) versus one that reduces it by 0.5 days (95% CI: -0.2 to 1.2 days) tell very different stories — the first is more precisely estimated and both bounds suggest some benefit, while the second interval includes negative values (harm), making the result less conclusive despite the same point estimate.

In manufacturing quality control, process capability is measured using confidence intervals around key measurements. A component specified at 25.00 ± 0.05 mm requires process measurements with confidence intervals well within that tolerance. Six Sigma methodology demands that the process mean plus/minus six standard deviations falls within specifications — equivalent to a defect rate below 3.4 per million parts.

Sample Size Planning — The Cost of Precision

The sample size formula for estimating a proportion is n = z*² × p(1-p) / E², where E is the desired margin of error. Setting p = 0.5 maximizes the required sample size (worst case). For a national poll wanting ±3% accuracy at 95% confidence: n = 1.96² × 0.5 × 0.5 / 0.03² = 1,068 respondents. Cutting the margin of error in half (to ±1.5%) requires quadrupling the sample to 4,268 — this quadratic relationship is why ultra-precise surveys are expensive.

💡 Pro Tip — Overlapping CIs Don't Mean No Difference: A common error is concluding that two groups have no significant difference just because their confidence intervals overlap. Two 95% CIs can overlap considerably and still reflect a statistically significant difference — the correct test is to compute the CI of the difference, not to compare individual CIs visually. Overlapping CIs roughly correspond to p < 0.10 or so, not p < 0.05. If you need to compare two groups, calculate the difference and its CI directly.

Frequently Asked Questions

What does a 95% confidence interval actually mean?
A 95% confidence interval means that if you repeated your sampling procedure many times and computed a confidence interval each time, about 95% of those intervals would contain the true population parameter. It does not mean there is a 95% probability that the true value lies in your particular interval — once computed, that specific interval either contains the true value or it does not. This frequentist interpretation is subtle but important: the 95% refers to the procedure's reliability over the long run, not to any single interval.
How does sample size affect the confidence interval?
Sample size affects interval width through the standard error (s / √n). Quadrupling the sample size halves the margin of error. Going from n = 100 to n = 400 halves your margin of error; going from n = 100 to n = 1,600 quarters it. This diminishing return means that very precise estimates require very large samples. A survey seeking ±1% precision needs about 9,604 respondents at 95% confidence — nearly 10 times the standard ~1,000-person national poll for ±3% precision.
When should I use a wider confidence interval (99% instead of 95%)?
Use a wider 99% or 99.9% confidence interval when the cost of being wrong is very high. Medical device testing, pharmaceutical trials, aviation safety studies, and structural engineering analysis typically use 99% or higher confidence. The tradeoff is a wider, less precise interval — a 99% CI is about 35% wider than a 95% CI for the same data. In exploratory research where you're willing to be wrong more often in exchange for narrower intervals, 90% confidence may be appropriate.
What is the margin of error and how is it calculated?
The margin of error (ME) is half the width of the confidence interval: ME = z* × (s / √n) for means, or ME = z* × √(p̂(1-p̂)/n) for proportions. It represents the maximum expected difference between your sample statistic and the true population parameter, at the given confidence level. A poll reporting "52% ± 3%" has a margin of error of 3 percentage points, meaning the 95% CI spans from 49% to 55%. Margin of error is always reported at a specific confidence level — "margin of error" without specifying the confidence level is incomplete.
How do I interpret a confidence interval that includes zero?
When a confidence interval for a difference or effect includes zero, it means the data are consistent with no effect at that confidence level. For example, a 95% CI of (-0.3 to 2.1 kg) for weight loss means you cannot rule out that the true weight loss is zero (or even slightly negative). This corresponds to a p-value greater than 0.05 — the result is not statistically significant at the 5% level. A CI that excludes zero corresponds to a significant result: a 95% CI of (0.4 to 2.8 kg) means the effect is significantly positive at p < 0.05.
What sample size do I need for a national survey?
For a national political poll aiming for ±3% margin of error at 95% confidence (the standard), you need approximately 1,068 respondents, regardless of the country's population size. This surprises many people — a poll of 1,068 Americans is just as statistically valid as a poll of 1,068 people in a country of 10 million, because the margin of error depends on sample size, not population size (assuming random sampling). For ±2% precision, you need about 2,401 respondents; for ±1%, about 9,604.