Confidence Interval Calculator

A confidence interval for a mean is the sample mean plus or minus a critical value times the standard error. Use t when the standard deviation comes from your sample.

Also called: Margin of error calculator (mean)

  • Last updated
  • Formula tested against reference values

Your numbers

The sample standard deviation s, or the population σ if it is known.

Method

Result

Confidence interval
—

Calculating…

Lower bound
—
Upper bound
—
Margin of error (±)
—
Standard error
—
Critical value (t* or z*)
—
Degrees of freedom (t only)
—

How to use this calculator

  1. Enter or choose sample mean (x̄).
  2. Enter or choose standard deviation.
  3. Enter or choose sample size (n).
  4. Enter or choose confidence level.
  5. Enter or choose method.
  6. The confidence interval updates as you type. Use Copy result or Share to keep it.

Method

CI = x̄ ± c × s ÷ √n, where c = t(1 − α/2, n − 1) or z(1 − α/2), and α = 1 − confidence

x̄
sample mean
s
standard deviation
n
sample size
c
two-sided critical value

Worked example

  1. Standard error = 10 ÷ √25 = 2.
  2. t* for 95% with 24 degrees of freedom = 2.0639.
  3. Margin = 2.0639 × 2 = 4.1278, so the interval is 50 ± 4.1278.

With a sample mean of 50, s = 10 and n = 25, the 95% confidence interval for the mean is 45.87 to 54.13.

What the result means

If you repeated the sampling many times, about 95% of intervals built this way would contain the true mean. A narrower interval needs a larger sample: halving the margin takes roughly four times as many observations.

Assumptions and limits

  • Observations are independent and come from a random sample.
  • The population is roughly normal, or the sample is large enough (about 30+) for the mean to be close to normal.
  • This is for a single mean. Proportions, differences between groups and paired data need different formulas.
  • Strong skew or outliers in small samples make the interval unreliable.

Questions

Should I use t or z?

Use t whenever the standard deviation is estimated from the sample, which is almost always. Use z only when σ is genuinely known in advance. For large n they give nearly the same answer.

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

Not strictly. The true mean is fixed; the 95% describes how often the method captures it over repeated samples.