Statistics Calculator › Confidence Interval Calculator

Confidence Interval Calculator

Get the confidence interval for a population mean from your sample mean, standard deviation and sample size, using the t or z distribution.

What a confidence interval is

A confidence interval is a range of plausible values for the true population mean, built from your sample. A 95% confidence level means that if you repeated the sampling many times, about 95% of the intervals built this way would contain the true mean.

CI = x̄ ± t* × s ÷ √n (σ unknown, the usual case)
CI = x̄ ± z* × σ ÷ √n (σ known)

Worked example

A sample of 30 has mean 72.5 and standard deviation 8.4. For 95% confidence with 29 degrees of freedom, t* = 2.045. The margin of error is 2.045 × 8.4 ÷ √30 = 3.137, so the interval is 69.36 to 75.64.

Critical values

Levelz*t* (df = 9)t* (df = 29)
90%1.6451.8331.699
95%1.962.2622.045
99%2.5763.252.756

t values are larger than z values for small samples, which widens the interval to account for the extra uncertainty in estimating the standard deviation. As n grows, t approaches z.

t or z?

Use t whenever the standard deviation comes from your sample, which is nearly always. Use z only when the population standard deviation is genuinely known in advance. The interval also assumes a random sample and either roughly normal data or a reasonably large n.

What makes an interval wider

Formulas follow the NIST/SEMATECH e-Handbook of Statistical Methods: confidence limits for the mean.

Frequently asked questions

Does a 95% interval mean there is a 95% chance the mean is inside it?

Strictly, no. The true mean is fixed; the 95% describes the method. Across many repeated samples, 95% of intervals built this way would contain it.

What is the margin of error?

Half the width of the interval: critical value × standard error. The interval is the sample mean plus and minus the margin of error.

How do I make the interval narrower?

Collect a larger sample or accept a lower confidence level. Quadrupling the sample size roughly halves the margin of error.

More statistics calculators