How it works
A confidence interval gives a range of plausible values for the true population mean based on a sample. A 95% interval is built so that, across many repeated samples, about 95% of such intervals would contain the true mean.
Because the standard deviation is estimated from the sample, this calculator uses the t-distribution with n − 1 degrees of freedom, which has heavier tails than the normal curve and widens the interval to reflect the extra uncertainty in the standard deviation. For large samples the t critical value approaches the normal (z) value, 1.96 at 95%.
The interval narrows as the sample grows or the spread shrinks, and widens as you ask for higher confidence.
Formula
CI = x̄ ± t* × s ÷ √n, with t* from the t-distribution with n − 1 degrees of freedom
Questions people ask
Does a 95% confidence interval mean there is a 95% chance the true mean is inside it?
Strictly, no. The true mean is fixed; the 95% describes the method. If you repeated the study many times, about 95% of the intervals you built would contain it.
When should I use t instead of z?
Use t whenever the population standard deviation is unknown and estimated from the sample, which is almost always. The difference matters most for small samples; as the sample grows the t and z values converge (at 95%, t is 2.045 for n = 30 and 1.984 for n = 100, versus z = 1.960).
How can I make the interval narrower?
Increase the sample size (the width shrinks with √n), reduce measurement variability, or accept a lower confidence level.