🧮
🧮 Math & statistics

Confidence Interval Calculator (mean)

Results update as you type.

Your numbers

Understanding the confidence interval for a mean — concept and principle

A confidence interval gives a range of plausible values for a population mean, based on a sample mean, its standard deviation and the sample size. Instead of reporting "the average is 50", you report "the average is 50, with a 95% confidence interval of 47.0 to 53.0". It is standard in research reports, quality control and survey summaries.

95% confidence interval around a sample mean of 50The standard error is 8 ÷ √30 = 1.461. Multiplying by t* = 2.045 (29 degrees of freedom) gives a margin of 2.987, so the interval is 47.01 to 52.99. The z interval, 47.14 to 52.86, is a little narrower.Mean 50, give or take 2.998 ÷ √30SE = 1.461×t* = 2.045df 29, 95%=± 2.987margin46474849505152535447.0152.9947.1452.86t intervalz (narrower)47.01 – 52.9995% confidence interval for the mean
SE × t* sets the width: 50 ± 2.987 gives 47.01 to 52.99.

How it is calculated

The interval is in the same unit as the mean.

The principle

Sample means vary from sample to sample with spread SE. Because the true σ is unknown and estimated by s, the standardised mean follows a t distribution, which has heavier tails than the normal, especially for small n. William Sealy Gosset published this result in 1908 under the pseudonym "Student". As n grows, t* approaches z*, and the two intervals converge.

Worked example

  1. Inputs: x̄ = 50, s = 8, n = 30, confidence 95%.
  2. SE = 8 ÷ √30 = 1.460593.
  3. Degrees of freedom = 29, so t* = 2.045229642.
  4. Margin of error = 2.045230 × 1.460593 = 2.987249094.
  5. t interval: 50 ± 2.987249 = 47.01275091 – 52.98724909.
  6. z interval: 50 ± 1.959964 × 1.460593 = 50 ± 2.862711 = 47.13728937 – 52.86271063.

How to read the result

"95% confidence" describes the method: if you repeated the sampling many times, about 95% of the intervals built this way would contain the true mean. The z interval is slightly narrower and therefore too optimistic when σ is estimated from the sample. A narrower interval needs a larger sample: halving the margin of error requires about four times as many observations.

Common mistakes

Keep in mind: The t interval assumes a random sample and roughly normal data, or a sample large enough for the central limit theorem. Strong skew or outliers with small n can make it misleading.

Frequently asked questions

Should I use t or z?

Use t whenever the standard deviation comes from the sample, which is almost always. Use z only when σ is truly known.

Why does a 99% interval come out wider?

Higher confidence requires a larger critical value (t* ≈ 2.756 for 99% with 29 df), so the range widens.

Two intervals overlap; are the means different?

Overlap does not prove the means are equal. Use a two-sample t-test to compare them directly.

Sources: Student (1908). The probable error of a mean. Biometrika, 6(1), 1–25. · NIST/SEMATECH e-Handbook of Statistical Methods.

Checked 8 Nov 2026. Standard formulas, computed in your browser with double-precision numbers.

🧮 All math & statistics tools →🌍 Calculators by country →