Skip to content
Omnikalc

Confidence interval calculator for a mean

Calculate the confidence interval of a sample mean from the standard deviation and sample size, with the margin of error and the standard error.

Updated on
Your inputs

Value out of range

Value out of range

Value out of range

Results

Lower bound

30.040

Upper bound

33.960

Margin of error (±)
1.960
Large sample: z interval
Standard error of the mean
1.0000
Critical value z*
1.960

Margin of error for other sample sizes

Margin of error (±)Lower boundUpper bound
16 current3.92028.08035.920
30 current2.86329.13734.863
64 current1.96030.04033.960
100 current1.56830.43233.568
400 current0.78431.21632.784
1,000 current0.49631.50432.496

What a confidence interval tells you

A sample mean is an estimate. Take another sample and you would get a slightly different number. A confidence interval gives a range that captures this uncertainty: with a 95% interval, the method used would contain the true population mean in 95% of repeated samples. The width depends on three things: the spread of the data, the sample size and the confidence level you choose.

The formulas

  • Standard error of the mean: SE = s ÷ √n
  • Margin of error: E = z* × SE
  • Interval: mean − E to mean + E

The critical value z* depends on the confidence level: 1.645 for 90%, 1.960 for 95%, 2.326 for 98%, 2.576 for 99% and 3.291 for 99.9%.

Worked example

A food delivery service times 64 orders. The average delivery takes 32 minutes, with a standard deviation of 8 minutes.

  1. Standard error: 8 ÷ √64 = 1 minute.
  2. Margin of error at 95%: 1.96 × 1 = 1.96 minutes.
  3. 95% confidence interval: 30.04 to 33.96 minutes.
  4. At 99% the interval widens to 29.42 to 34.58 minutes; at 90% it narrows to 30.36 to 33.64.

Sample size and precision

Because the standard error shrinks with the square root of n, halving the margin of error takes four times as many observations:

Sample size Margin of error (95%) Interval
16 ±3.92 28.08 to 35.92
64 ±1.96 30.04 to 33.96
100 ±1.57 30.43 to 33.57
400 ±0.78 31.22 to 32.78
1,000 ±0.50 31.50 to 32.50

Small samples: use the t distribution

The calculator uses the normal (z) distribution, which is accurate for samples of about 30 or more. For smaller samples, replace z* with the t value for n − 1 degrees of freedom, which gives a wider interval:

Sample size t* at 95%
5 2.776
10 2.262
15 2.145
20 2.093
30 2.045
Large 1.960

For a proportion, such as a poll result, use the margin of error calculator instead.

Common misreadings

  • A 95% interval does not contain 95% of the individual values. That would be the much wider range mean ± 1.96 × s.
  • It does not say there is a 95% probability that the true mean is in this particular interval; the true mean is fixed and either is or is not inside.
  • Two overlapping intervals do not prove that two means are equal. Use a proper test of the difference.

Frequently asked questions

How do you calculate a 95% confidence interval?

Mean ± 1.96 × standard deviation ÷ √n. With a mean of 32, a standard deviation of 8 and 64 observations, the interval is 32 ± 1.96, or 30.04 to 33.96.

What does a 95% confidence interval mean?

If you repeated the sampling many times, about 95% of the intervals built this way would contain the true mean. It does not mean there is a 95% chance that this particular interval contains it.

What z values are used for common confidence levels?

1.645 for 90%, 1.960 for 95%, 2.326 for 98% and 2.576 for 99%.

When should I use the t distribution instead?

When the sample is small, roughly under 30, and the population standard deviation is estimated from the sample. The t value is larger than z, which widens the interval: 2.064 instead of 1.96 for 25 observations at 95%.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.