Confidence Interval Calculator
Enter sample statistics to calculate a confidence interval and margin of error.
Results
Confidence Intervals Explained
A confidence interval (CI) gives a range of plausible values for an unknown population parameter based on sample data. It combines your sample estimate with a margin of error that reflects both the variability in your data and your desired level of confidence.
The Formula
CI = x̄ ± z* × (σ / √n). Where x̄ is the sample mean, z* is the critical z-value for the chosen confidence level, σ is the standard deviation, and n is the sample size. The margin of error (ME) = z* × (σ/√n) is the ± half-width of the interval.
Confidence Levels
The confidence level indicates how often the interval-building procedure produces intervals containing the true parameter. For 95% confidence (z*=1.96): if you collected 100 different samples and built 100 CIs, about 95 would contain the true mean. Common levels: 90% (z*=1.645), 95% (z*=1.96), 99% (z*=2.576).
What Affects Interval Width?
Wider interval ← higher confidence level (more certainty requires wider range). Wider interval ← larger standard deviation (more data variability). Narrower interval ← larger sample size (more data → more precise estimate). The margin of error shrinks by 1/√n, so quadrupling sample size halves the margin of error.
Common Misconception
A 95% CI does NOT mean "95% probability that the true mean is in this interval." The true mean is fixed — it either is or isn't in the interval. The 95% refers to the long-run success rate of the procedure that generated the interval. This is a subtle but important distinction in frequentist statistics.
Worked Example: Survey Confidence Interval
A survey of 100 people measures satisfaction scores with a sample mean of 72 and a standard deviation of 15. For a 95% confidence interval: Standard Error = 15 / √100 = 1.5. Margin of Error = 1.96 × 1.5 = 2.94. The 95% CI is (72 − 2.94, 72 + 2.94) = (69.06, 74.94). You can be 95% confident the true population mean falls between 69.06 and 74.94.
| Confidence Level | z* Value | Example (mean=50, SD=10, n=100) | Interval Width |
|---|---|---|---|
| 90% | 1.645 | (48.36, 51.64) | 3.29 |
| 95% | 1.960 | (48.04, 51.96) | 3.92 |
| 99% | 2.576 | (47.42, 52.58) | 5.15 |
Frequently Asked Questions
A CI is a range of values likely containing the true population parameter. A 95% CI means: if this procedure were repeated many times, about 95% of the resulting intervals would contain the true value.
ME = z* × (σ/√n). It's the ± half-width of the confidence interval. The full interval spans from (mean − ME) to (mean + ME).
z* = 1.96 for 95%. For 90%: z* = 1.645. For 99%: z* = 2.576. These are the z-values where (1−confidence)/2 of the normal distribution lies in each tail.
Larger n → smaller margin of error. The ME is proportional to 1/√n, so quadrupling n halves the margin of error. Going from n=100 to n=400 cuts the interval width in half.
Use a t-interval (t-distribution) instead of z when: sample size is small (n < 30) and the population SD is unknown. The t-distribution has heavier tails to account for the additional uncertainty.
Increase your sample size (the most effective method — quadrupling n halves the margin of error), reduce variability in your sample through better measurement or more homogeneous sampling, or accept a lower confidence level (90% instead of 95% gives a narrower interval, but with less certainty).
A confidence interval estimates where the population mean lies. A prediction interval estimates where a single new observation will fall — and is always wider because it must account for both sampling uncertainty and individual variability. Prediction intervals are common in regression analysis and forecasting.