Calculate the confidence interval around a sample mean. Enter the sample size, sample mean, standard deviation, and confidence level to see the critical Z-score, margin of error, and lower and upper bounds.
How to use this calculator
Enter the number of independent observations, their mean, the standard deviation in the same units as the mean, and the confidence level as a percentage, such as 95. The tool always computes a two-sided Z interval for a mean; there is no distribution or interval-method selector.
The standard-deviation field is labeled s. A Z interval is exact under a normal model with known population standard deviation σ; substituting a sample estimate s makes this a normal approximation. For a small normal sample with unknown σ, use a Student's t procedure instead. A proportion or a difference between groups requires a different formula.
Examples
95% interval for the default sample
With n = 50, mean = 20.6, and standard deviation = 3.2, the 95% critical value is 1.9600. The result is 20.6 ± 0.887, or [19.713, 21.487]. The mean and endpoints have the same units as the observations. If these were sample statistics, the displayed interval is a Z approximation.
Four times the sample size
Keeping mean = 20.6, standard deviation = 3.2, and confidence = 95%, change
n from 50 to 200. The margin falls from about 0.887 to 0.443, and the
interval becomes [20.157, 21.043]. Quadrupling n halves the unrounded margin
because standard error is proportional to 1 / √n.
Formula
The normal confidence interval is:
CI = x̄ ± Z × s / √n
Here, x̄ is the sample mean, s is the entered standard deviation, n is
the sample size, and Z is the two-sided critical value for the chosen
confidence level. At 95%, the critical value leaves 2.5% in each tail.
A higher confidence level produces a wider interval. A larger sample size produces a narrower interval, all else equal.
Inference assumptions
A 95% confidence procedure covers the fixed population mean in about 95% of repeated samples under its assumptions. It does not assign a 95% probability to the mean being inside this one observed interval. Independent observations and a suitable normal or large-sample model matter; nonrandom samples, clustering, weighting, and repeated testing need other methods. See the NIST/SEMATECH confidence interval overview.