ToolNimba

๐Ÿ“Š Confidence Interval Calculator for a Mean

By ToolNimba Editorial Team ยท Updated 2026-06-20

Margin of error
-
Lower bound
-
Upper bound
-
Confidence interval
-

Enter your sample statistics to estimate the range that likely contains the true population mean.

A confidence interval gives you a range of plausible values for the true population mean, built from a single sample. Instead of reporting just one number, you report a lower and upper bound plus a confidence level (commonly 90, 95 or 99 percent) that describes how often intervals built this way would capture the real mean. Enter your sample mean, standard deviation and sample size, pick a confidence level, and this calculator returns the margin of error and both bounds straight away.

What is the Confidence Interval Calculator?

A confidence interval turns a single sample estimate into an honest range. When you measure a sample, the sample mean almost never equals the true population mean exactly, because of random sampling variation. The confidence interval expresses that uncertainty: it says the true mean is plausibly somewhere between a lower bound and an upper bound, given the spread in your data and how many observations you collected.

The interval is built as the sample mean plus or minus a margin of error. The margin of error has two parts. The first is the standard error, s divided by the square root of n, which shrinks as your sample grows because larger samples pin down the mean more tightly. The second is a critical value (the z score) that comes from the confidence level. A higher confidence level uses a larger z, so demanding 99 percent confidence produces a wider interval than 90 percent. There is always a trade off: more confidence means less precision.

The confidence level is widely misread. A 95 percent confidence interval does not mean there is a 95 percent probability that this one interval contains the true mean. The true mean is a fixed number; this particular interval either contains it or it does not. What 95 percent describes is the long run method: if you repeated the whole sampling procedure many times and built an interval each time, about 95 percent of those intervals would capture the true mean. The confidence is in the procedure, not in any single result.

This calculator uses the z based formula, which assumes you either know the population standard deviation or have a large enough sample (a common rule of thumb is n of 30 or more) for the normal approximation to hold. For small samples where the standard deviation is estimated from the data, statisticians use the t distribution instead, which has slightly wider intervals to account for that extra uncertainty. For most everyday survey and measurement work with a healthy sample size, the z based interval shown here is accurate and standard.

When to use it

  • Reporting survey results, such as average satisfaction score, with an honest margin of error rather than a single point estimate.
  • Quality control: estimating the true average weight, length or fill volume of a production run from a sample of units.
  • Summarising experiment or A/B test data where you need the plausible range for a measured average, not just the observed mean.
  • Coursework and exams in statistics, where you must compute a 90, 95 or 99 percent confidence interval and show the margin of error.

How to use the Confidence Interval Calculator

  1. Enter the sample mean (the average you calculated from your data).
  2. Enter the sample standard deviation and the sample size n.
  3. Choose a confidence level of 90, 95 or 99 percent from the dropdown.
  4. Read off the margin of error and the lower and upper bounds, then copy the interval if you need it.

Formula & method

Confidence interval for a mean: x̄ ± z × (s / √n). Here x̄ is the sample mean, s is the sample standard deviation, n is the sample size, and the standard error is s / √n. The critical value z depends on the confidence level: 90% uses z = 1.645, 95% uses z = 1.960, and 99% uses z = 2.576. The margin of error is z × (s / √n), the lower bound is x̄ minus the margin, and the upper bound is x̄ plus the margin.

Worked examples

A sample of 36 light bulbs has a mean life of 100 hours with a standard deviation of 15 hours. Find the 95 percent confidence interval for the true mean life.

  1. Identify the inputs: mean = 100, s = 15, n = 36, confidence = 95% so z = 1.960.
  2. Standard error = s / sqrt(n) = 15 / sqrt(36) = 15 / 6 = 2.5.
  3. Margin of error = z times standard error = 1.960 times 2.5 = 4.9.
  4. Lower bound = 100 minus 4.9 = 95.1; upper bound = 100 plus 4.9 = 104.9.

Result: 95% CI = 100 plus or minus 4.9 = [95.1, 104.9] hours.

A poll of 400 people gives a mean weekly spend of 50 dollars with a standard deviation of 20 dollars. Find the 99 percent confidence interval.

  1. Inputs: mean = 50, s = 20, n = 400, confidence = 99% so z = 2.576.
  2. Standard error = 20 / sqrt(400) = 20 / 20 = 1.
  3. Margin of error = 2.576 times 1 = 2.576.
  4. Lower bound = 50 minus 2.576 = 47.424; upper bound = 50 plus 2.576 = 52.576.

Result: 99% CI = 50 plus or minus 2.576 = [47.42, 52.58] dollars (rounded).

Common z critical values by confidence level (two sided)

Confidence levelz critical valueRelative width
80%1.282Narrowest
90%1.645Narrow
95%1.960Standard
98%2.326Wide
99%2.576Widest

How sample size shrinks the margin of error (s = 15, 95% confidence)

Sample size nStandard error (s / sqrt(n))Margin of error (z times SE)
95.0009.80
362.5004.90
1001.5002.94
4000.7501.47

Common mistakes to avoid

  • Reading the confidence level as a probability for one interval. A 95 percent confidence interval does not mean a 95 percent chance the true mean is inside this specific range. The 95 percent refers to the method over many repeated samples, not to a single computed interval.
  • Using standard deviation instead of standard error. The margin of error uses the standard error s / sqrt(n), not the raw standard deviation s. Forgetting to divide by the square root of n produces an interval that is far too wide.
  • Picking the wrong critical value for the confidence level. Each confidence level has its own z value (90% is 1.645, 95% is 1.960, 99% is 2.576). Mixing them up, for example using 1.96 for a 99 percent interval, gives a margin of error that is too small.
  • Using z for a tiny sample. The z based interval assumes a large sample or a known population standard deviation. For small samples with an estimated standard deviation, the t distribution is more accurate and gives a slightly wider, more honest interval.

Glossary

Confidence interval
A range of plausible values for an unknown population parameter, here the mean, built from sample data and a chosen confidence level.
Confidence level
The long run percentage of intervals, built by this same procedure, that would contain the true mean. Common choices are 90, 95 and 99 percent.
Margin of error
The plus or minus amount added to and subtracted from the sample mean. It equals the critical value times the standard error.
Standard error
The standard deviation of the sample mean, computed as s divided by the square root of n. It measures how much the sample mean is expected to vary.
Critical value (z)
A multiplier from the standard normal distribution that corresponds to the chosen confidence level, such as 1.960 for 95 percent.
Sample size (n)
The number of observations in your sample. A larger n shrinks the standard error and produces a narrower interval.

Frequently asked questions

What is a confidence interval in simple terms?

It is a range that likely contains the true average for a whole population, estimated from one sample. Rather than reporting a single number, you report a lower bound, an upper bound and how confident the method is, for example 95 percent.

What z value should I use for a 95 percent confidence interval?

Use z = 1.960 for a 95 percent confidence interval. For 90 percent use 1.645, and for 99 percent use 2.576. These come from the standard normal distribution for a two sided interval.

How do I calculate the margin of error?

Multiply the critical value by the standard error: margin of error = z times (s divided by the square root of n). The standard error is the sample standard deviation divided by the square root of the sample size.

Why does a higher confidence level give a wider interval?

A higher confidence level uses a larger z value, which multiplies the standard error by more. To be more certain that the interval captures the true mean, you have to make the interval wider, so there is a trade off between confidence and precision.

Should I use the z distribution or the t distribution?

Use z when the population standard deviation is known or the sample is large (often n of 30 or more). Use the t distribution for small samples where the standard deviation is estimated from the data, because it gives slightly wider, more cautious intervals.

How can I make a confidence interval narrower?

Collect a larger sample, since the standard error falls with the square root of n. You can also lower the confidence level, for example from 99 to 90 percent, or reduce variability in the data, though a bigger sample is usually the most reliable option.