For a mean, step by step, with the z and t versions and a worked example.
Written & reviewed by Dackohn; last reviewed October 2026.
To calculate a confidence interval for a mean: (1) compute the sample mean, (2) find the standard error SE = s / √n, (3) pick the critical value (1.96 for 95% with large n, or a t-value for small samples), (4) margin of error = critical × SE, (5) the interval is mean ± margin. Example: mean 100, s = 15, n = 40 gives a 95% CI of about [95.2, 104.8].
CI = x̄ ± (critical value) × (s / √n). The critical value is z (1.96 for 95%) when n is large or σ is known, and a t-value with n−1 df for small samples.
n = 40, mean = 100, s = 15.
The t-interval is slightly wider and is the correct choice when σ is estimated from the sample.
=CONFIDENCE.T(0.05, s, n)=CONFIDENCE.NORM(0.05, s, n)Add and subtract the result from the mean.
A 95% CI means that over many repeated studies, about 95% of such intervals would contain the true mean — not a 95% probability for this one interval. See the confidence intervals guide.
Do it instantly: the confidence interval calculator builds the interval from your data or summary stats.