Confidence Interval Calculator

Turn a sample mean, a standard deviation, and a sample size into a confidence interval in seconds. Enter your numbers and this calculator gives you the margin of error and the lower and upper bounds, so you can say how precisely your sample pins down the true population mean.

The default example is a classic one: a sample mean of 100, a standard deviation of 15, and 100 observations give a 95% confidence interval of 97.06 to 102.94 — a margin of error of just 2.94. Bigger samples shrink the interval; higher confidence levels widen it.

100% FreeNo sign-upInstant results
Advanced options

The t-distribution is the safer choice when the sample is small (roughly under 30) and the population standard deviation is estimated from the sample. It gives a slightly wider interval than the z-distribution. t critical values are built in for 95% confidence with degrees of freedom 1 to 30; above 30 the t value is effectively the z value, 1.96. At 90% or 99% confidence the calculator uses the z value even with this box checked.

Defaults are already included in the result: 95% confidence with the z-distribution. Open Advanced options to switch to the t-distribution.

Your information is not stored. Calculations are done in your browser.

Your 95% confidence interval
97.06 to 102.94
Sample mean 100, standard deviation 15, sample size 100. We are 95% confident the true population mean lies between 97.06 and 102.94.
Margin of error2.94
Standard error1.50
Critical value1.96 (z)
Interval width5.88

A margin of error of 2.94 means the sample mean of 100 could plausibly come from a population mean anywhere from 97.06 to 102.94. Quadrupling the sample size would roughly halve this margin.

Key takeaways

  • Mean 100, standard deviation 15, sample size 100, 95% confidence: standard error 15 / sqrt(100) = 1.50, margin of error 1.96 x 1.50 = 2.94, interval 97.06 to 102.94.
  • The same sample at 99% confidence widens to 96.14 to 103.86 (margin 3.86), because the critical value rises from 1.96 to 2.576.
  • A smaller sample of 25 with the same mean and standard deviation gives a 95% t-interval of 93.81 to 106.19 (margin 6.19) — small samples are much less precise.
  • 95% confidence does not mean there is a 95% chance this particular interval contains the mean. It means 95% of intervals built this way, over many repeated samples, would contain it.

Contents

Formula

Standard error, critical values, and margin of error.

Worked examples

95%, 99%, and small-sample t intervals.

Common mistakes

What a confidence interval does and does not say.

Related tools

Formula

Confidence interval = sample mean plus or minus margin of error, where margin of error = critical value x standard error and standard error = standard deviation / sqrt(sample size). For the default example: standard error = 15 / sqrt(100) = 15 / 10 = 1.50; margin of error = 1.96 x 1.50 = 2.94; interval = 100 – 2.94 to 100 + 2.94 = 97.06 to 102.94.

The critical value depends on the confidence level and on whether you use the z-distribution or the t-distribution:

Confidence levelz critical valueWhat it means
90%1.645Narrower interval, less confidence
95%1.96The standard choice in most reports
99%2.576Wider interval, more confidence

Use the z-distribution when the sample is large (roughly 30 or more) or the population standard deviation is known. Use the t-distribution for small samples when the standard deviation is estimated from the sample itself — the t critical value is larger, which honestly reflects the extra uncertainty. At 95% confidence with 24 degrees of freedom (sample size 25), the t value is 2.064 instead of 1.96.

Three things move the interval: a larger sample size shrinks the standard error and narrows the interval; a larger standard deviation widens it; a higher confidence level widens it. To halve the margin of error, you need roughly four times the sample size, because the standard error divides by the square root of n.

Worked examples

Example 1: the default — mean 100, standard deviation 15, n 100, 95%

Standard error = 15 / sqrt(100) = 1.50. Margin of error = 1.96 x 1.50 = 2.94. Interval = 97.06 to 102.94. This is the textbook case behind the calculator defaults.

Example 2: higher confidence — the same sample at 99%

Standard error is still 1.50, but the critical value rises to 2.576. Margin of error = 2.576 x 1.50 = 3.86. Interval = 96.14 to 103.86. More confidence costs width.

Example 3: small sample with the t-distribution — mean 100, standard deviation 15, n 25, 95%

Standard error = 15 / sqrt(25) = 3.00. Degrees of freedom = 24, so the t critical value is 2.064. Margin of error = 2.064 x 3.00 = 6.19. Interval = 93.81 to 106.19. Compare with the z version of the same sample: margin 5.88, interval 94.12 to 105.88 — the t interval is honestly wider.

Example 4: a survey-style case — mean 50, standard deviation 10, n 25, 95% z

Standard error = 10 / sqrt(25) = 2.00. Margin of error = 1.96 x 2.00 = 3.92. Interval = 46.08 to 53.92.

How it works

  1. Enter your sample statistics — the sample mean, the standard deviation, and the sample size — and pick a confidence level.
  2. Pick z or t — leave the default z for large samples, or open Advanced options and check the t-distribution box for small samples.
  3. Read the interval — the margin of error plus the lower and upper bounds, with the standard error and critical value shown for checking.

Common mistakes

Mistake 1: reading 95% as a probability about this interval. Once the interval is computed, the true mean is either inside it or not. The 95% describes the method over many repeated samples, not the odds for one interval.

Mistake 2: using the standard deviation where the standard error belongs. The margin of error uses standard deviation / sqrt(n), not the standard deviation itself. Forgetting the sqrt(n) step overstates the margin by a factor of sqrt(n) — ten times too wide for n = 100.

Mistake 3: using z for a tiny sample. With 10 observations and an estimated standard deviation, the z interval is too narrow. The t-distribution exists exactly for this case; at 95% with 9 degrees of freedom the critical value is 2.262, not 1.96.

Mistake 4: comparing two overlapping intervals and declaring no difference. Two intervals can overlap while the difference between the means is still statistically significant. Overlapping intervals are not a significance test.

Mistake 5: treating the interval as a range the data falls in. A confidence interval for the mean is much narrower than the spread of the raw data. About 95% of individual observations fall within roughly two standard deviations of the mean, which for the default example is 70 to 130 — far wider than 97.06 to 102.94.

Frequently asked questions

What is a confidence interval?

A range of values, built from a sample, that is likely to contain the true population mean. A 95% confidence interval of 97.06 to 102.94 means the method that produced it captures the true mean in 95% of repeated samples.

How do I calculate a 95% confidence interval?

Divide the standard deviation by the square root of the sample size to get the standard error, multiply by 1.96 to get the margin of error, then add and subtract it from the sample mean. For mean 100, standard deviation 15, and n 100: standard error 1.50, margin 2.94, interval 97.06 to 102.94.

Should I use the z-distribution or the t-distribution?

Use z for large samples (roughly 30 or more) or when the population standard deviation is known. Use t for small samples when the standard deviation comes from the sample itself. The t interval is wider, which is the honest price of a small sample.

Why does a bigger sample give a narrower interval?

Because the standard error is the standard deviation divided by the square root of n. Quadrupling n halves the standard error, and therefore halves the margin of error. Doubling n only shrinks it by a factor of about 1.41.

What does 95% confidence really mean?

It describes the long-run performance of the method: if you repeated the sampling and interval-building process many times, about 95% of the intervals would contain the true population mean. It is not a 95% probability that this one interval contains it.

Can I use this calculator for a proportion, like a poll result?

Not directly. This calculator is for a mean from a sample mean and standard deviation. A proportion interval uses a different standard error, sqrt(p(1-p)/n), with p as the observed proportion. For poll margins of error, use a dedicated margin-of-error calculation with that formula.