Skip to content
CalcSpectrum

Confidence Interval Calculator

Calculate a z-based confidence interval for a population mean from a sample mean, standard deviation, sample size, and confidence level.

Free to use · Instant results
Loading calculator…

How It's Calculated

Formula

CI = \bar{x} \pm z \times \frac{s}{\sqrt{n}}

A confidence interval estimates a range that likely contains the true population mean, based on a sample. The margin of error is the z critical value (which depends on your chosen confidence level) multiplied by the standard error (the sample standard deviation divided by the square root of the sample size). The confidence interval is then the sample mean plus or minus that margin of error. This calculator uses the standard z critical values for the three most common confidence levels: 1.645 for 90%, 1.96 for 95%, and 2.576 for 99% — these are fixed, well-known constants from the standard normal distribution, not something that needs to be solved numerically. A larger sample size shrinks the standard error (and therefore the interval), while a higher confidence level widens it. Standard deviation and sample size must both be greater than zero, and sample size must be a whole number.

Worked Examples

95% confidence interval: mean 50, SD 10, n = 25

  1. Standard error: 10 / √25 = 10 / 5 = 2
  2. Margin of error: 1.96 x 2 = 3.92
  3. Interval: 50 - 3.92 to 50 + 3.92 = 46.08 to 53.92

90% confidence interval: mean 100, SD 15, n = 36

  1. Standard error: 15 / √36 = 15 / 6 = 2.5
  2. Margin of error: 1.645 x 2.5 = 4.1125
  3. Interval: 100 - 4.1125 to 100 + 4.1125 = 95.8875 to 104.1125

Frequently Asked Questions

What does a 95% confidence interval actually mean?

It means that if you repeated the same sampling process many times and built a confidence interval each time, about 95% of those intervals would contain the true population mean. It does not mean there's a 95% probability the true mean falls in this one specific interval.

Why does a bigger sample size shrink the interval?

The standard error is the standard deviation divided by the square root of the sample size. As the sample size grows, that denominator grows too, shrinking the standard error and therefore the margin of error — larger samples give more precise estimates.

Why are only 90%, 95%, and 99% confidence levels supported?

These are the three confidence levels used in the overwhelming majority of statistics coursework and research, with well-known, universally published z critical values (1.645, 1.96, and 2.576). Other confidence levels require solving the inverse normal distribution numerically, which is out of scope for this calculator.

When should I use a z interval instead of a t interval?

A z-based interval (used here) is appropriate when the population standard deviation is known or the sample size is large (usually n >= 30). For small samples with an unknown population standard deviation, a t-distribution interval is technically more accurate, but the z approximation is the standard default and is very close for the sample sizes typically encountered.