Confidence Interval Calculator
Enter sample mean, standard deviation, and sample size to calculate the confidence interval for the population mean — get the margin of error, lower and upper bounds, and interpretation at your chosen confidence level.
Enter your values above to see the results.
Tips & Notes
- ✓To halve the margin of error, you need to quadruple the sample size (ME ∝ 1/√n). Reducing ME from ±5 to ±2.5 requires 4× as many observations — not 2×.
- ✓Use t* instead of z* when the sample size is small (n < 30) and population standard deviation is unknown. T* is always larger than z*, producing wider (more honest) intervals for small samples.
- ✓The 95% confidence interval does NOT mean there is a 95% probability that the true mean falls in the interval. The interval is fixed once computed; the probability is either 0 or 1. The 95% refers to the long-run success rate of the procedure.
- ✓Standard error (SE = s/√n) measures the precision of the mean estimate. Confidence interval width = 2 × z* × SE. Larger samples produce smaller SE and therefore narrower intervals.
- ✓Confidence intervals are more informative than p-values alone. An interval that excludes zero (or the null value) corresponds to a significant test, but the interval also shows the magnitude of the effect — p-values do not.
Common Mistakes
- ✗Misinterpreting "95% confidence" as "95% probability the true mean is in the interval". The true mean is fixed (though unknown); the interval either contains it or not. The 95% refers to the proportion of intervals that would capture the true mean if you repeated the study many times.
- ✗Using z* for small samples when t* is required. For n < 30 with unknown σ, z* underestimates the true critical value, making the interval too narrow. Always use t* with df = n−1 for small samples.
- ✗Confusing margin of error with standard error. SE = s/√n measures the variability of the sample mean. Margin of error = z* × SE and is always larger than SE. The confidence interval is x̄ ± ME, not x̄ ± SE.
- ✗Assuming a wider confidence interval means the data is worse. A 99% CI is always wider than a 95% CI for the same data — this is not a problem, it is the cost of higher confidence. Wider intervals simply reflect honest uncertainty.
- ✗Applying one confidence interval to multiple comparisons without adjustment. If you compute 20 separate 95% CIs, you expect roughly 1 to miss the true value by chance. Use Bonferroni or other corrections when making multiple interval estimates.
Confidence Interval Calculator Overview
A confidence interval gives you a range of plausible values for a population parameter based on sample data. Instead of a single point estimate ("the average is 42"), a confidence interval provides a range ("the average is likely between 38 and 46, with 95% confidence"). This range quantifies the uncertainty inherent in drawing conclusions about a population from a limited sample.
Confidence interval for a mean (z-method, large samples):
CI = x̄ ± z* × (σ / √n) | Margin of error = z* × (σ / √n)
EX: x̄=50, σ=10, n=100, 95% confidence → z*=1.96 → ME = 1.96×(10/√100) = 1.96×1 = 1.96 → CI: [48.04, 51.96]Confidence interval for a mean (t-method, small samples):
CI = x̄ ± t*(df) × (s / √n) | df = n − 1
EX: x̄=50, s=10, n=20, 95% confidence → t*(19df)=2.093 → ME = 2.093×(10/√20) = 2.093×2.236 = 4.68 → CI: [45.32, 54.68]Critical values for common confidence levels:
| Confidence Level | α | Z* (large n) | t* (df=30) | t* (df=10) |
|---|---|---|---|---|
| 90% | 0.10 | 1.645 | 1.697 | 1.812 |
| 95% | 0.05 | 1.960 | 2.042 | 2.228 |
| 99% | 0.01 | 2.576 | 2.750 | 3.169 |
Frequently Asked Questions
A 95% CI means the procedure used to construct it will capture the true population mean in 95% of random samples. If you collected 100 different samples and computed a 95% CI from each, approximately 95 of those intervals would contain the true population mean. The interval from your specific sample either contains the true mean or it does not — but 95% confidence means the method works 95% of the time.
Larger samples produce narrower (more precise) intervals. The margin of error = z* × s/√n decreases as n increases. To cut the margin of error in half, you need 4× the sample size (because √(4n) = 2√n). Example: n=100 gives ME=1.96 for s=10. To achieve ME=0.98, you need n=400. This inverse square root relationship means large gains in precision require very large sample size increases.
Use t* (t-interval) when: the population standard deviation is unknown and estimated by s, and the sample size is small (n < 30). Use z* (z-interval) when: σ is known (rare in practice), or n ≥ 30 (central limit theorem makes the t-distribution close to normal). In practice, σ is almost always unknown, so t-intervals are the standard choice — with large n, t* ≈ z* and the distinction is negligible.
They are two sides of the same coin. A 95% CI excludes a null value (e.g., zero) if and only if the corresponding two-tailed test rejects H₀ at α=0.05. CI: [3.2, 8.7] excludes zero → p < 0.05 for H₀: μ=0. CI: [−1.2, 6.5] includes zero → p ≥ 0.05. Confidence intervals are more informative than p-values because they show both significance and the size of the effect.
Wider CI: higher confidence level (99% > 95% > 90%), smaller sample size (n=10 > n=100), larger data spread (higher s). Narrower CI: lower confidence level, larger sample size, smaller data spread. The trade-off is precision vs. confidence: a 50% CI would be very narrow but would miss the true mean half the time. The 95% level balances precision and reliability for most applications.
Yes, and it is perfectly valid. If you are estimating a mean difference (Group A − Group B) and the 95% CI is [−3.2, 1.8], this means the difference could plausibly be negative (A lower than B) or positive (A higher than B). Since the interval contains zero, the test is not statistically significant at α=0.05 — you cannot conclude which group has the higher mean. Negative bounds simply reflect the range of plausible values.