Confidence Interval for Mean Calculator
A confidence interval for the mean estimates the range within which the true population mean is likely to fall, given sample data. You specify a confidence level (commonly 90%, 95%, or 99%), and the calculator computes the interval using the z-distribution for large samples (n at least 30) or the t-distribution for small samples. The width of the interval depends on the sample size, the variability of the data, and the confidence level: more confidence requires a wider interval, and a larger sample produces a narrower one. Enter your sample mean, standard deviation, sample size, and confidence level below to get the lower and upper bounds and the margin of error.
Confidence interval formula
CI = x̄ ± z* × (s / √n)
Where x̄ is the sample mean, z* is the critical value (1.645 for 90%, 1.960 for 95%, 2.576 for 99%), s is the sample standard deviation, and n is the sample size. For small samples (n < 30), replace z* with the t critical value at n-1 degrees of freedom.
Interpreting confidence intervals
- A 95% confidence interval does not mean there is a 95% probability that the true mean is inside this particular interval. The true mean is fixed; it is either inside the interval or not.
- The correct interpretation: if you drew many random samples and computed an interval for each, about 95% of those intervals would contain the true mean.
- Narrower intervals are more precise but require larger samples or lower confidence levels.
- The margin of error equals the half-width of the interval: upper bound minus lower bound, divided by 2.
Frequently asked questions
What is a confidence interval for the mean?
A confidence interval gives a range of plausible values for the true population mean based on sample data. A 95% confidence interval means that if you repeated the sampling many times, 95% of the intervals constructed would contain the true population mean.
When do I use z versus t?
Use the z-distribution when the population standard deviation is known or the sample size is large (n >= 30). Use the t-distribution when the population standard deviation is unknown and the sample size is small (n < 30). This calculator uses z for n >= 30 and t for n < 30.
What does the margin of error mean?
The margin of error is half the width of the confidence interval. It represents the maximum expected difference between the sample mean and the true population mean at your chosen confidence level.
How does sample size affect the interval?
Larger samples produce narrower confidence intervals because the standard error (s divided by the square root of n) decreases as n increases. Doubling the sample size reduces the margin of error by about 29%.
What is the formula for a confidence interval for the mean?
CI = x-bar plus or minus z times (s divided by sqrt(n)), where x-bar is the sample mean, z is the critical value for the chosen confidence level, s is the sample standard deviation, and n is the sample size.
Official sources
- NIST/SEMATECH e-Handbook of Statistical Methods: Confidence Limits for the Mean.
- NIST/SEMATECH e-Handbook: Engineering Statistics Handbook.
Reviewed by the CalculatorHub team, edited by James Graham, 15 June 2026. See our methodology.