Confidence Interval Calculator

Build a confidence interval for a mean from the sample mean, standard deviation and sample size, using z or t.

%
Confidence interval
94.3989 to 105.601

We are 95% confident the population mean lies between 94.399 and 105.6.

Sampling distribution of the mean — middle 95% shaded
95%91.78494.52397.261100102.739105.477108.21694.399105.6
Lower bound
94.398908
Upper bound
105.601092
Margin of error
5.601092
Standard error
2.738613
Critical value
2.04523
Show the working
  1. Standard error SE = s ÷ √n = 15 ÷ √30 = 2.73861
  2. Critical value t* for 95% with df = 29: 2.04523
  3. Margin of error = t* × SE = 2.04523 × 2.73861 = 5.60109
  4. CI = 100 ± 5.60109 = (94.3989, 105.601)

Runs entirely in your browser. Nothing you enter is uploaded.

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.

esc