Skip to content
Calculator.hair

Confidence Interval Calculator

%

Press Calculate to see the results.

Enter a sample's size, mean and standard deviation, choose a confidence level, and this confidence interval calculator returns the interval for the population mean and its margin of error.

A sample mean is only an estimate of the true population mean. A confidence interval puts a range around that estimate to show how precise it is, based on how variable the data is and how many observations you have.

What is the confidence interval?

A confidence interval is a range of values, calculated from a sample, that is likely to contain an unknown population parameter such as the mean. It is written as the estimate plus or minus a margin of error. With the default inputs, a sample of 50 values with a mean of 20.6 and a standard deviation of 3.2 gives a 95% confidence interval of 20.6 ± 0.887, or 19.713 to 21.487.

The confidence level describes the method, not any single interval. A 95% confidence level means that if you drew many samples and built an interval from each in the same way, about 95% of those intervals would capture the true mean. It does not mean there is a 95% probability that the true mean lies in this particular interval; the true mean is fixed, and a given interval either contains it or does not.

The width of the interval depends on three things. A higher confidence level needs a larger critical value and so a wider interval: 90%, 95% and 99% use Z values of about 1.645, 1.960 and 2.576. More variable data, a larger standard deviation, widens the interval in proportion. A larger sample narrows it, but only with the square root of n, so quadrupling the sample size halves the margin of error.

This calculator uses the normal distribution, which is appropriate when the population standard deviation is known or the sample is reasonably large, roughly 30 or more. The standard error σ ÷ √n measures how much sample means vary from sample to sample, and multiplying it by Z gives the margin of error. When the sample is small and the standard deviation is estimated from the same data, statisticians use Student's t-distribution instead; its critical values are larger, giving wider intervals. For n = 10 at 95% confidence, t is about 2.262 rather than 1.96.

Confidence intervals appear throughout research and polling. A poll reporting 48% support with a margin of error of ±3 points at 95% confidence is giving the interval 45% to 51%. For proportions the standard error is √(p(1 − p) ÷ n) instead of σ ÷ √n, but the logic is identical. In medicine, a treatment effect whose 95% interval excludes zero is commonly described as statistically significant at the 5% level.

CI = x̄ ± Z × σ ÷ √n

x̄
sample mean
Z
critical value for the confidence level (1.96 for 95%)
σ
standard deviation
n
sample size

Critical Z values for common confidence levels:

Confidence levelZ
70%1.036
80%1.282
85%1.440
90%1.645
95%1.960
98%2.326
99%2.576
99.5%2.807
99.9%3.291

Frequently asked questions

What does a 95% confidence interval mean?

If you repeated the sampling many times and built an interval each time, about 95% of the intervals would contain the true population mean.

How do I make a confidence interval narrower?

Increase the sample size or accept a lower confidence level. Quadrupling the sample size halves the margin of error.

What z-values are used for 90%, 95% and 99% confidence intervals?

About 1.645 for 90%, 1.96 for 95% and 2.576 for 99%. A higher confidence level needs a larger multiplier, so the interval gets wider.

When should I use a t-distribution instead?

When the sample is small (under about 30) and the standard deviation is estimated from the sample itself.

What is the formula for a confidence interval for a mean?

CI = x̄ ± Z × σ ÷ √n. With the default sample of 50, a mean of 20.6 and a standard deviation of 3.2, the 95% margin of error is 1.96 × 3.2 ÷ √50 ≈ 0.887, so the interval runs from about 19.71 to 21.49.

Updated by Calculator.hair. How we build and check our calculators