Calculate confidence intervals for means and proportions at 90%, 95%, 99% and custom levels. Includes sample size calculator for a target margin of error.
A confidence interval is more informative than a p-value alone because it shows you the magnitude of an effect, not just whether one exists. A clinical trial might show a drug reduces recovery time with p = 0.02 — but the 95% CI of (-0.1 to 4.3 days) reveals that the true effect could be negligible or moderately useful. The p-value passes a threshold; the CI tells you what's actually plausible. Polling provides the most familiar example. When a poll reports '52% support with ±3%,' that ±3% is the margin of error at 95% confidence. The formula uses n = 1,068 — the standard sample size for national polls. Critically, this sample size works regardless of the total population: a poll of 1,068 Americans is as statistically valid for a country of 330 million as for 10 million, because the margin of error depends on sample size, not population size. The most important practical insight: doubling your precision costs four times the sample size. Cutting a ±3% margin of error to ±1.5% requires going from 1,068 respondents to 4,268 — four times more. This quadratic relationship is why ultra-precise surveys are expensive, and why pollsters accept ±3% as the practical sweet spot between accuracy and cost.
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.
| Confidence Level | Alpha (α) | Z-score (z*) | Common Use |
|---|---|---|---|
| 90% | 0.10 | 1.645 | Quick estimates, exploratory research |
| 95% | 0.05 | 1.960 | Standard in most fields |
| 99% | 0.01 | 2.576 | Medical, safety-critical research |
| 99.9% | 0.001 | 3.291 | High-stakes decisions, quality control |
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).
Built-in z-interval and t-interval functions return exact confidence bounds with one calculation.
View on Amazon →A classic that teaches you to critically evaluate margins of error, polls, and confidence claims in the media.
View on Amazon →Quick-reference guide to confidence intervals, margin of error, and sample size formulas.
View on Amazon →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.
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.