How it works
The interval is the sample mean plus or minus a margin: the z value of the confidence level times the standard deviation divided by the square root of the sample size. Larger samples and lower variation tighten the interval; asking for higher confidence widens it.
Formula
Interval = mean − margin to mean + margin.
z = 1.644854 (90%), 1.959964 (95%), 2.575829 (99%).
Example
Example in plain words. Mean 100, standard deviation 15, from 50 observations, at 95%.
Margin: 1.959964 × 15 ÷ sqrt(50) = 4.158.
Interval: 100 − 4.158 to 100 + 4.158, that is 95.84 to 104.16.
Frequently asked questions
What does the interval mean?
Repeating the sampling many times, 95% of the intervals built this way contain the true mean. It is a statement about the method, not a probability for this one interval.
When is this valid?
For large samples or roughly normal data. Small samples from normal data use the t value instead of z, which is slightly wider.