Confidence Interval Calculator: Gauge the Mean Free in 3 Steps

Confidence Interval Calculator mean

Compute a confidence interval for a mean from the sample mean, standard deviation and size.

Confidence interval
Margin of error
Lower bound
Upper bound
z*
Show working (LaTeX)

Uses the z (large-sample) interval. For small n with unknown σ, a t-interval is more accurate.

This free confidence interval calculator builds a confidence interval for a population mean from the sample mean, standard deviation, sample size and confidence level — with the margin of error shown.

How to use the confidence interval calculator

Enter the sample mean, standard deviation and size, pick a confidence level, and press Calculate. The confidence interval calculator returns the interval, the margin of error and the critical value. As a margin of error calculator and a 95 confidence interval calculator, it covers the most common cases instantly.

confidence interval calculator normal curve with the central confidence region shaded
A 95% confidence interval captures the central 95% of the sampling distribution.

What is a confidence interval?

A confidence interval is a range that is likely to contain the true population mean, with a stated level of confidence. See the confidence interval reference for details.

Definition. A 95% confidence interval means that if you repeated the sampling many times, about 95% of the intervals you build would contain the true mean.

Confidence interval formula

$$\bar{x}\pm z^{*}\cdot\frac{\sigma}{\sqrt{n}}$$

where $z^{*}$ is the critical value (1.96 for 95%) and $\sigma/\sqrt{n}$ is the standard error.

How to build a confidence interval step by step

  1. Find the sample mean and standard deviation.
  2. Pick a confidence level and its critical value z*.
  3. Add and subtract the margin of error $z^{*}\sigma/\sqrt{n}$.
⚠️ Small samplesFor a small sample with unknown population standard deviation, use a t-interval instead of z — the t critical value is a little larger.

Worked example

With mean 50, SD 8, n = 30 and 95% confidence, the margin of error is $1.96\times 8/\sqrt{30}\approx 2.86$, so the interval is about [47.14, 52.86].

Why confidence intervals matter in machine learning

In machine learning for beginners, confidence intervals quantify the uncertainty of a metric — for example reporting accuracy as 0.85 ± 0.03 across cross-validation folds. They build on the standard deviation and the z-score.

🤖 ML insight

Reporting a model metric with a confidence interval is far more honest than a single number — it tells readers how much the score might move on new data.

Frequently asked questions

What does this confidence interval calculator need?
The sample mean, the standard deviation, the sample size and a confidence level.
What is the margin of error?
Half the width of the interval: the critical value times the standard error.
What z value is used for 95%?
z* = 1.96 for a 95% confidence interval.
Should I use z or t?
Use z for large samples or known sigma; use t for small samples with unknown sigma.
Is the confidence interval calculator free?
Yes, completely free and browser-based.

What affects the width

Three things control how wide the range is. A higher confidence level (99% versus 90%) widens it, because you demand more certainty. A larger sample size narrows it, since the standard error shrinks with the square root of n. And more variable data — a bigger standard deviation — widens it.

A common misreading is “there is a 95% chance the true mean is inside this range.” The true mean is fixed; it is the range that is random. The honest phrasing is that 95% of the ranges built this way would capture the true mean over many repeated samples.

Confidence interval calculator: summary

This confidence interval calculator turns a sample into a clear range for the mean. Pair it with the standard deviation calculator and the p value calculator.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top