A confidence interval gives a range likely to contain the true population mean, based on a sample. This computes it — and explains what “95% confidence” actually claims, since it is not what most people assume on first hearing it.
How it works
Margin of error and interval
margin = z × (σ / √n) · interval = [x̄ − margin, x̄ + margin]
z is 1.645 for 90% confidence, 1.96 for 95%, or 2.576 for 99% — the standard critical values of the normal distribution.
What “95% confidence” actually means
It does not mean “there is a 95% chance the true mean is in this specific range.” Once the data is collected, the true mean either is or is not in this particular interval — there is no probability left over to assign. It means that if this same sampling and interval-construction process were repeated many times, about 95% of the resulting intervals would contain the true mean. This distinction trips up nearly everyone the first time they learn it, which is why it is stated directly here rather than left as an unaddressed footnote.
Why this is the z-interval, and when that is not the right tool
This calculator uses the z-distribution, the standard approach for a large sample or a known population standard deviation. With a small sample — conventionally under about 30 — or a standard deviation estimated from the sample itself, the statistically correct interval uses the t-distribution instead, which is wider to account for the extra uncertainty a small sample carries. This page flags results computed from a small sample as an approximation rather than presenting them with the same confidence as a large-sample result.
How to use this calculator
- Enter the sample mean, standard deviation and sample size.
- Choose a confidence level.
- Read the interval — and treat it as approximate if your sample size is small.
Frequently asked questions
Why does a higher confidence level give a wider interval?
Because being more certain of capturing the true mean requires casting a wider net — 99% confidence demands a larger margin than 90%, for the identical underlying data.
Why does a larger sample narrow the interval?
Because the margin of error divides by the square root of the sample size — a bigger sample gives a more precise estimate of the mean, so the interval needed to be confident of capturing the truth shrinks.
What’s the difference between the z-interval and the t-interval?
The t-interval accounts for the extra uncertainty of estimating the population’s spread from a small sample rather than knowing it exactly — it uses a wider critical value than z, and the difference between the two shrinks as the sample grows, becoming negligible above roughly 30.
Can the confidence interval be centred somewhere other than the sample mean?
Not in this standard form — the interval is always symmetric around the sample mean by construction, since the margin is added and subtracted equally on both sides.
Does a wider interval mean worse data?
Not necessarily — it can simply reflect a smaller sample or a higher chosen confidence level, both legitimate choices rather than flaws in the underlying data.