Confidence Interval Calculator
Calculate confidence intervals for sample means or proportions.
Result
What Is a Confidence Interval?
A confidence interval provides a range of values that likely contains the true population parameter. For example, a 95% confidence interval means that if you repeated your study 100 times, approximately 95 of those intervals would contain the true value.
CI = Point Estimate ± Margin of Error
Formulas
CI for Mean
CI = x̄ ± z × (σ / √n)
CI for Proportion
CI = p̂ ± z × √(p̂(1-p̂) / n)
Z-Scores for Common Confidence Levels
| Confidence Level | Z-Score | Alpha (α) |
|---|---|---|
| 90% | 1.645 | 0.10 |
| 95% | 1.96 | 0.05 |
| 99% | 2.576 | 0.01 |
| 99.9% | 3.291 | 0.001 |
How Sample Size Affects Confidence Intervals
The margin of error shrinks as sample size increases. Specifically, doubling precision requires quadrupling the sample size — a classic trade-off in research design and polling.
| Sample Size (n) | Margin of Error (σ=10, 95%) | CI Width |
|---|---|---|
| 25 | ±3.92 | 7.84 |
| 100 | ±1.96 | 3.92 |
| 400 | ±0.98 | 1.96 |
| 1,600 | ±0.49 | 0.98 |
To halve the margin of error, you need 4× the sample size. This is why large clinical trials are expensive — achieving narrow confidence intervals requires very large enrollment.
Step-by-Step Examples
CI for Mean: Average test score
Sample mean x̄ = 75, σ = 12, n = 64, 95% CI (z = 1.96)
- Standard Error (SE) = σ/√n = 12/√64 = 12/8 = 1.5
- Margin of Error = z × SE = 1.96 × 1.5 = 2.94
- Lower bound = 75 − 2.94 = 72.06
- Upper bound = 75 + 2.94 = 77.94
- Result: 95% CI: [72.06, 77.94]
CI for Proportion: Election poll
Sample proportion p̂ = 0.52 (52%), n = 1000, 95% CI
- SE = √(p̂(1−p̂)/n) = √(0.52 × 0.48 / 1000) = √(0.0002496) ≈ 0.0158
- MOE = 1.96 × 0.0158 ≈ 0.031 (±3.1%)
- Lower = 0.52 − 0.031 = 48.9%
- Upper = 0.52 + 0.031 = 55.1%
- This poll cannot declare a winner — both >50% and <50% are in the interval
Common Misconceptions About Confidence Intervals
❌ Myth: "There's a 95% chance the true value is in this interval"
The true value either IS or IS NOT in your specific interval — there's no probability for a fixed interval. The 95% refers to the procedure: 95% of intervals constructed this way will contain the true value.
❌ Myth: A wider CI means something went wrong
A wider CI just means less precision — often due to small sample size or high variability. It's honest uncertainty. It's more trustworthy than a falsely narrow CI from an underpowered study.
✅ Reality: Use CIs alongside p-values
A 95% CI that doesn't contain zero is equivalent to a two-tailed p < 0.05 test. But CIs provide richer information — they show the plausible range of the effect size, not just a binary significant/not-significant verdict.