Skip to content

Confidence Interval Calculator

Confidence interval for a mean from sample mean, SD and n, using t (n-1 df) or z at any confidence level.

Maintained by the Calcenzo team. Last reviewed September 25, 2026. Methodology

Confidence Interval Calculator

A confidence interval calculator gives a range of plausible values for a population mean, based on a sample’s mean, standard deviation and size. For a mean of 50, SD 10 and n = 40, the 95% t interval is about 46.80 to 53.20.

confidence interval calculator
Confidence interval calculator chart: t and z intervals for mean 50, SD 10, n 40.

How to use the confidence interval calculator

  1. Enter the sample mean and standard deviation.
  2. Enter the sample size.
  3. Choose the confidence level, such as 95%, and t or z.
  4. Read the lower and upper limits.

What formula does the confidence interval calculator use?

  • Standard error SE = s ÷ √n
  • Interval = mean ± critical value × SE
  • Default: the t critical value with n − 1 degrees of freedom, the textbook choice when the standard deviation is estimated from the sample
  • Optional z (normal) critical values: 1.645 for 90%, 1.960 for 95%, 2.576 for 99%

The confidence interval calculator estimates a range for a population mean from a sample’s mean, standard deviation and size.

Confidence interval calculator worked example

A sample of 40 has a mean of 50 and a standard deviation of 10. The standard error is 10 ÷ √40 = 1.581. With 39 degrees of freedom the 95% t value is 2.023, so the margin of error is 2.023 × 1.581 = 3.198 and the interval is 46.80 to 53.20. Using z = 1.96 instead gives 46.90 to 53.10.

Confidence t (39 df) t interval z z interval
80% 1.304 47.94 – 52.06 1.282 47.97 – 52.03
90% 1.685 47.34 – 52.66 1.645 47.40 – 52.60
95% 2.023 46.80 – 53.20 1.960 46.90 – 53.10
99% 2.708 45.72 – 54.28 2.576 45.93 – 54.07

z or t?

The NIST/SEMATECH e-Handbook of Statistical Methods gives confidence limits for the mean using the t distribution with n − 1 degrees of freedom, because the population standard deviation is usually unknown and has to be estimated from the sample. This confidence interval calculator uses t by default and computes the exact critical value for your sample size. For n = 40 the difference from z is small, but it grows for small samples: with n = 10, t is 2.262, about 15% wider than z, and the 95% interval for the example becomes 42.85 to 57.15. Choose z only when the population standard deviation is genuinely known.

Confidence levels supported

Any confidence level between 0% and 100% is accepted, not just 90%, 95% and 99%. The critical value is calculated directly from the t or normal distribution, so an 80% interval uses t = 1.304 (or z = 1.282) as shown in the table. The confidence interval calculator also lists the critical value, standard error and margin of error so you can check each step.

What the interval means

A 95% confidence interval comes from a method that captures the true population mean in 95% of repeated samples. It does not mean there is a 95% probability that the true mean lies in this particular interval, and it does not say that 95% of individual values fall inside it. To halve the width you need four times the sample size, because the standard error shrinks with the square root of n.

Assumptions

  • The sample is random and observations are independent.
  • The data are roughly normal, or the sample is large enough (often n ≥ 30) for the mean to be approximately normal.
  • Strong skew or outliers can make the interval misleading; check a plot of the data first.

Using intervals in practice

Confidence intervals appear wherever a sample stands in for a larger group. A factory might weigh 40 bags from a production run to estimate the average fill weight; a survey reports an average household income with a margin of error; a clinical study reports the average change in blood pressure with a 95% interval. In each case the interval shows how precise the estimate is, which a single average cannot.

Comparing groups needs care. If two intervals do not overlap, the difference is usually statistically significant, but overlapping intervals do not prove there is no difference. For a formal comparison, use a test for the difference between means or build an interval for the difference itself.

Planning works backward from the interval you want. To estimate a mean to within ±2 units at 95% when the standard deviation is about 10, you need roughly (1.96 × 10 ÷ 2)² ≈ 97 observations. A sample size calculator does this step for you, and the confidence interval calculator then shows the precision you actually achieved once the data are in.

Related calculators:

Sources

NIST/SEMATECH e-Handbook of Statistical Methods: Confidence limits for the mean.

Questions about this calculator

What is the 95% z value?

1.96.

Should I use z or t?

t with n − 1 df when the SD comes from the sample, which is the default here.

What does 95% confidence mean?

The method captures the true mean in 95% of repeated samples.

How do I make the interval narrower?

Increase the sample size; 4× n halves the width.

Does it support 80% or other levels?

Yes, any level between 0% and 100%.

Check the assumptions and units before relying on a result. Financial, tax and health estimates do not replace advice for your individual circumstances.

Report a calculation issue