Confidence Interval Formula
Calculate confidence intervals for any sample using CI = x̄ ± z*(σ/√n).
Returns 90%, 95%, and 99% intervals for surveys, experiments, and statistical inference.
The Formula
A confidence interval gives a range of values that is likely to contain the true population parameter. The wider the interval, the more confident you can be — but the less precise the estimate.
Variables
| Symbol | Meaning |
|---|---|
| CI | Confidence interval (lower bound to upper bound) |
| x̄ | Sample mean |
| z | Z-score for desired confidence level (1.96 for 95%, 2.576 for 99%) |
| σ | Standard deviation (population or sample) |
| n | Sample size |
| σ/√n | Standard error of the mean |
Example 1
Sample of 100 students: mean score = 75, σ = 10. Find the 95% CI.
Standard error = 10 / √100 = 10 / 10 = 1
Margin of error = 1.96 × 1 = 1.96
95% CI: 75 ± 1.96 = (73.04, 76.96)
Example 2
Survey of 400 people: mean spending = $150, σ = $40. Find the 99% CI.
Standard error = 40 / √400 = 40 / 20 = 2
Margin of error = 2.576 × 2 = 5.15
99% CI: $150 ± $5.15 = ($144.85, $155.15)
When to Use It
Use the confidence interval formula when:
- Estimating population parameters from sample data
- Reporting survey results with a margin of error
- Determining if two groups are statistically different
- Deciding how large a sample you need for a desired precision
Key Notes
- What it means: A 95% confidence interval means that if you repeated the experiment many times and built a CI each time, about 95% of those intervals would contain the true population parameter — not that there is a 95% chance the true value lies in this specific interval.
- Formula for mean (large sample): CI = x̄ ± z × (σ/√n): z = 1.96 for 95% CI, 2.576 for 99% CI. For small samples (n < 30) or unknown σ, use the t-distribution instead of z.
- Wider CI means more uncertainty: CI width increases with higher confidence level (e.g., 99% vs 95%), higher variability (σ), and smaller sample size (n). To halve the CI width, you must quadruple the sample size.
- CI and statistical significance: If a 95% CI for a difference does not include zero, the result is statistically significant at the 0.05 level — this is exactly equivalent to a two-tailed hypothesis test.
- Margin of error: The margin of error (MoE) is z × (σ/√n) — half the total CI width. Opinion polls often report MoE: "±3 percentage points" means the 95% CI has a half-width of 3%.