Math Calculators

Confidence Interval Calculator

Enter the sample statistics and confidence level, then click Calculate

Confidence interval: 19.7130215517 – 21.4869784483

Confidence level
95%
Sample size
50
Sample mean
20.6
Standard deviation
3.2
Standard error
0.45254834
z-score
1.9599639861
Margin of error
±0.8869784483
Relative margin
4.306%
Lower bound
19.7130215517
Upper bound
21.4869784483
This interval assumes a normal sampling distribution with a known population standard deviation, or a sample large enough for the sample standard deviation to be a close estimate.

What this calculator does

A confidence interval estimates the range in which an unknown population mean is likely to fall. Instead of reporting a single sample mean, the interval adds a margin of error that reflects sampling uncertainty. This calculator builds that interval from four inputs: the sample size, the sample mean, the standard deviation, and the confidence level.

The result appears as a center plus or minus a margin, as a percentage margin relative to the mean, and as a lower and upper bound.

How to use this calculator

  1. Enter the number of observations in the sample.
  2. Enter the sample mean.
  3. Enter the standard deviation. If the population standard deviation is unknown, use the sample standard deviation when the sample is large.
  4. Enter the confidence level as a percentage, such as 90, 95, or 99. Any value strictly between 0 and 100 is accepted.
  5. Click Calculate.

The headline shows the interval bounds. The summary rows show the standard error, the z-score for the chosen confidence level, the margin of error, and the relative margin.

Formulas

Standard error: SE = σ / √n

Margin of error: E = z × SE

Confidence interval: x̄ ± E

z = Φ⁻¹(1 − (1 − confidence level / 100) / 2)

Here x̄ is the sample mean, σ is the standard deviation, n is the sample size, and Φ⁻¹ is the inverse standard normal distribution. The z-value is calculated for the exact confidence level you enter, so custom levels work as well as common ones.

Default example

The default inputs are a sample size of 50, a sample mean of 20.6, a standard deviation of 3.2, and a confidence level of 95%. The z-value is about 1.96, the standard error is about 0.45255, and the margin of error is about 0.88698.

The interval is therefore 20.6 ± 0.887, or roughly 19.713 to 21.487. Relative to the mean, the margin is about 4.3%. At a 90% confidence level with the same data, the z-value falls to about 1.645 and the interval becomes narrower, because a lower confidence level requires less coverage.

Assumptions and limitations

  • The interval assumes a normal sampling distribution, which is reasonable when the sample is large or the population is normal.
  • The population standard deviation is treated as known, or the sample standard deviation is treated as a close estimate. For small samples with an unknown standard deviation, a t interval is usually more appropriate.
  • The observations should come from a random sample and should be independent of one another.
  • A confidence level is not the probability that a particular calculated interval contains the true mean. It describes the long-run success rate of the procedure.
  • A zero or negative standard deviation and a sample size below one are rejected.
  • A relative margin is omitted when the mean is zero.

Frequently asked questions

What does a 95% confidence level actually mean?

It means that if the same sampling procedure were repeated many times and an interval were built each time, about 95% of those intervals would contain the true population mean. It does not mean there is a 95% chance that this particular interval contains the true value.

Why does a larger sample produce a narrower interval?

The standard error is the standard deviation divided by the square root of the sample size. As the sample grows, the denominator grows, so the standard error and the margin of error shrink. Quadrupling the sample size halves the width of the interval.

Should I use a z-value or a t-value?

Use a z-value when the population standard deviation is known or the sample is large. Use a t-value for small samples with an unknown population standard deviation; this page follows the z-based approach.

Reference tables

Z-values for common confidence levels

Confidence LevelZ Value
80%1.282
90%1.645
95%1.960
98%2.326
99%2.576

Interval notation

X̄ ± Z×s
x̄ ± z × (s ÷ √n)sample standard deviation

The interval is the sample mean plus or minus the z-value multiplied by the standard error. The standard error is the sample standard deviation divided by the square root of the sample size.

Source

Reference: Calculator.net — Confidence Interval Calculator.

Math Calculators