200 tools

Calculators · · 4 min read

How to Calculate a Confidence Interval for a Mean

Use the Confidence Interval Calculator to turn a sample mean, standard deviation and sample size into a confidence interval at any common level.

To calculate a confidence interval, open the Confidence Interval Calculator, enter your Sample mean, Standard deviation, and Sample size, pick a Confidence level, and read the interval directly — along with the margin of error and standard error behind it.

What a confidence interval tells you

A sample mean is just an estimate of the true population mean — if you took a different sample, you'd almost certainly get a slightly different number. A confidence interval gives you a range around that estimate instead of a single point, along with a stated confidence level (like 95%) for how often intervals built this way would contain the true mean if you repeated the sampling process. A wider interval means more uncertainty; a narrower one, usually from a bigger sample, means a tighter estimate.

How to calculate a confidence interval with Toolbench

  1. Open the Confidence Interval Calculator.
  2. Enter your Sample mean (default 50).
  3. Enter your Standard deviation (default 10) — this should be the standard deviation of your sample data.
  4. Enter your Sample size (default 100).
  5. Pick a Confidence level: 80%, 90%, 95%, 98%, 99%, or 99.9%.
  6. Read the main result — the confidence interval itself — plus the margin of error, standard error, and z-score in the rows below.

The calculator uses the normal (z) distribution. For small samples (n < 30), a t-interval would come out slightly wider than the z-interval shown here, so treat the result as a close approximation rather than an exact bound in that case.

A real worked example

With a sample mean of 50, a standard deviation of 10, a sample size of 100, and a 95% confidence level:

Field Value
95% confidence interval 48.04 – 51.96
Margin of error ± 1.96
Standard error 1
z-score 1.96
Written as 50 ± 1.96

The standard error is the standard deviation divided by the square root of the sample size: 10 ÷ √100 = 1. The margin of error is the z-score for 95% confidence (1.96) multiplied by that standard error: 1.96 × 1 = 1.96. Add and subtract that from the mean to get the interval: 50 − 1.96 = 48.04, and 50 + 1.96 = 51.96.

A second example at a different confidence level

Say you measured a mean of 72 with a standard deviation of 8 across a sample of 40, and you want a 90% confidence interval instead:

Field Value
90% confidence interval 69.9193 – 74.0807
Margin of error ± 2.0807
Standard error 1.2649
z-score 1.6449
Written as 72 ± 2.0807

Dropping the confidence level from 95% to 90% uses a smaller z-score (1.6449 instead of 1.96), which narrows the interval — you're trading some confidence for a tighter range.

How confidence level changes the interval

Confidence level z-score Effect on interval width
80% 1.2816 Narrowest
90% 1.6449 Narrower
95% 1.96 Standard default
98% 2.3263 Wider
99% 2.5758 Wider still
99.9% 3.2905 Widest

Everything else held constant, a higher confidence level always produces a wider interval — you need more room to be more sure the true mean falls inside it.

Tips and common mistakes

  • A wider interval isn't a worse result — it's a more honest one at a higher confidence level. Don't pick 99.9% just because it sounds more rigorous; match the confidence level to what your field or use case actually calls for.
  • The standard deviation you enter should come from your sample, not be guessed. A wrong or made-up standard deviation produces a confidence interval that looks precise but isn't meaningful.
  • A bigger sample size shrinks the interval, not the confidence level. If your interval feels too wide, collecting more data (which increases n and shrinks the standard error) is usually the real fix — switching confidence levels just moves the tradeoff around.
  • This calculator uses the z-distribution. It's a solid approximation for sample sizes of 30 or more; for a small sample, the true (t-distribution) interval is a bit wider than what's shown here.
  • Average Calculator — get the mean and standard deviation from a raw list of numbers before you plug them in here.
  • Probability Calculator — combined probabilities of two independent events and repeated trials.
  • Percentage Calculator — percent of, percent change, or increase/decrease by a percentage.

Frequently asked questions

What is a confidence interval?

A confidence interval is a range of values, built around a sample estimate, that's likely to contain the true population value. A 95% confidence interval means that if you repeated the sampling process many times, about 95% of the intervals you'd build would contain the true mean.

How do you calculate a 95% confidence interval?

Take the standard deviation, divide it by the square root of the sample size to get the standard error, then multiply that by the 95% z-score (1.96) to get the margin of error. Add and subtract the margin of error from the sample mean to get the interval's upper and lower bounds.

Why does a higher confidence level produce a wider interval?

A higher confidence level uses a larger z-score, which increases the margin of error. The interval has to be wider to have a better chance of containing the true mean.

Does sample size affect the confidence interval?

Yes — a larger sample size reduces the standard error (standard deviation divided by the square root of n), which narrows the interval without changing the confidence level.

Is my data sent to a server?

No. The calculation runs in your browser as you type. If you're signed in, your inputs sync privately to your account; if you're signed out, nothing is saved anywhere.

More guides

All guides →