Confidence Interval Calculator

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

How to use

  1. Enter the sample mean, standard deviation and sample size (n).
  2. Choose the confidence level — 90%, 95% or 99%.
  3. The interval and the margin of error appear instantly, with the formula breakdown shown below.

About this tool

A confidence interval gives a range of values that is likely to contain the true population mean, based on a sample. The 95% confidence interval means that if you repeated the sampling process many times, about 95% of the intervals computed this way would contain the true mean. It is not a probability statement about this particular interval — it is a statement about the method.

The calculation uses the normal approximation: margin of error = z × (σ / √n), where z is the critical value for the chosen confidence level (1.645 for 90%, 1.96 for 95%, 2.576 for 99%). The interval is the sample mean ± that margin. The standard error (σ / √n) shrinks with larger samples, which is why a larger n gives a narrower interval — more data means more precision.

This tool uses the z-distribution, which assumes the standard deviation is known and the sample is large enough for the central limit theorem to apply (roughly n ≥ 30). For small samples with an unknown σ, the t-distribution would be more appropriate — the difference is small for n above 30 and negligible above 100. Everything runs in your browser.

The formula

CI = x̄ ± z × (σ / √n). At 95%: z = 1.96. Margin of error = z × SE, where SE = σ / √n.

Frequently asked questions

What does 95% confidence mean?

It means that if you drew 100 different samples and computed the interval each time, about 95 of those intervals would contain the true population mean. It is not a 95% probability that this specific interval contains it.

How do I make the interval narrower?

Increase the sample size (n). Doubling n cuts the margin of error by about 30%. You can also lower the confidence level (from 99% to 95%), but that increases the chance of missing the true mean.

When should I use the t-distribution instead?

When the sample size is small (n < 30) and the population standard deviation is unknown. For n ≥ 30, the z and t distributions are nearly identical.

Can I use this for proportions?

No — this tool is for means. A proportion confidence interval uses a different formula (p̂ ± z × √(p̂(1−p̂)/n)).

Does the data leave my browser?

No. The calculation runs locally in JavaScript.

Related tools

Long links? Shorten them for free

Vai.la turns any URL into a short link with click statistics, QR Code and your own biolink.

Vai.la is not responsible for how the tools are used or for decisions made based on their results.