Home / Articles / How to calculate a confidence interval

How to Calculate a Confidence Interval

A confidence interval gives you a range within which the true population value is likely to fall, based on your sample data and the confidence level you choose.

Chris Terry
By Chris Terry, Founder & Editor
Updated June 17, 2026

Crunch your numbers

Paste your data set and get mean, variance, and standard deviation in seconds.

A 95% confidence interval for a mean is: CI = x-bar plus or minus (1.96 * sigma / sqrt(n)), where x-bar is the sample mean, sigma is the standard deviation, and n is the sample size. The 1.96 comes from the normal distribution's critical value for 95% coverage.

The formula

CI = x_bar +/- z * (sigma / sqrt(n))

When you do not know the population SD and your sample is small, use the t-distribution instead. The standard deviation calculator gives you the SD you need.

Worked example: 95% confidence interval for a mean

You measure reaction times for 50 participants. Sample mean = 280 ms, sample SD = 40 ms.

StepCalculationValue
Standard error40 / sqrt(50)5.66 ms
Margin of error (95%)1.96 * 5.6611.09 ms
Lower bound280 - 11.09268.9 ms
Upper bound280 + 11.09291.1 ms

The 95% confidence interval is 268.9 ms to 291.1 ms. You are 95% confident the true population mean reaction time falls in that range.

Where does 1.96 come from?

In the standard normal distribution (mean = 0, SD = 1), 95% of values fall between -1.96 and +1.96. This is a property of the bell curve: going 1.96 SDs in each direction from the center captures exactly 95% of the area under the curve. For 99% coverage, the comparable value is 2.576. These numbers come from z-score tables (also called normal distribution tables).

What does "95% confident" actually mean?

It does not mean there is a 95% chance the true value is in this specific interval. Rather, if you repeated the study 100 times with different samples, about 95 of the resulting intervals would contain the true population value. Any single interval either captures the true value or it does not; the 95% refers to the long-run reliability of the method, not this one interval. This is a subtle but important distinction in interpreting statistics.

How to find a 95% CI in Excel

Compute the margin of error with =CONFIDENCE.NORM(0.05, standard_dev, n), then subtract and add it to the mean. For small samples or unknown population SD, use =CONFIDENCE.T(0.05, standard_dev, n) instead. The z-score article covers how the critical value connects to the distribution.

Crunch your numbers

Paste your data set and get mean, variance, and standard deviation in seconds.

Related reading

Good to know

FAQs

How do I calculate a 95% confidence interval?

Formula: CI = mean +/- 1.96 * (SD / sqrt(n)). Find the standard error (SD divided by the square root of the sample size), multiply by 1.96, then add and subtract the result from the mean. The two resulting values are your lower and upper bounds.

What is the formula for calculating confidence intervals?

CI = x_bar +/- z * (sigma / sqrt(n)) for means, or CI = p_hat +/- z * sqrt(p_hat*(1-p_hat)/n) for proportions. The z value depends on confidence level: 1.96 for 95%, 1.645 for 90%, 2.576 for 99%.

How to get 1.96 for the 95% confidence interval?

1.96 is the z-score that leaves 2.5% in each tail of the standard normal distribution, so that 95% of the distribution falls between -1.96 and +1.96. It is looked up in a standard normal (z) table at the 0.025 probability level, or computed with the inverse normal function in any stats package.

How to find the 95% confidence interval in Excel?

Use =CONFIDENCE.NORM(0.05, standard_deviation, sample_size) to get the margin of error, then compute Lower = mean - margin and Upper = mean + margin. For small samples (unknown population SD), replace CONFIDENCE.NORM with CONFIDENCE.T, which uses the t-distribution.