Formula
CI = x̄ ± t* × s ÷ √n (σ unknown, df = n − 1)CI = x̄ ± z* × σ ÷ √n (σ known)z* = 1.645 (90%), 1.960 (95%), 2.576 (99%) How it works
A confidence interval gives a range of plausible values for a population mean, based on a sample. It is centred on the sample mean and extends by a margin of error on each side. The margin depends on how variable the data are, how many observations you have, and how confident you want to be.
The standard error s ÷ √n measures how much the sample mean would bounce around from sample to sample. Multiply it by a critical value — z* from the normal distribution if the population standard deviation is known, or t* from Student’s t distribution if you estimated it from the sample — to get the margin of error.
Higher confidence means a wider interval: 99% intervals are wider than 95% ones because they need to capture the true mean more often. Larger samples give narrower intervals, but because of the square root you need four times the data to halve the width.
Frequently asked questions
What does “95% confident” actually mean?
If you repeated the sampling many times and built an interval each time, about 95% of those intervals would contain the true population mean. Any single interval either contains it or doesn’t.
Should I use z or t?
Use t whenever the standard deviation comes from your sample, which is almost always. The difference is large for small samples and becomes negligible above roughly n = 100.
Does the data need to be normal?
For small samples the method assumes the population is roughly normal. For larger samples (often n ≥ 30) the central limit theorem makes the sample mean approximately normal anyway.