UTILS.
100% in-browser
±

Confidence Interval Calculator

Compute a confidence interval for a mean from its standard deviation and sample size, using the z or t distribution.

About this tool

The Confidence Interval Calculator is a free, in-browser tool that builds a confidence interval for a population mean from summary statistics: the sample mean, standard deviation and sample size. It reports the lower and upper bounds, the margin of error, the standard error and the critical value at any confidence level you choose.

By default it uses Student's t distribution with n − 1 degrees of freedom, which is correct when the population standard deviation is unknown (the usual case). Switch to the z method if the population standard deviation is known or the sample is very large. The t quantile is computed numerically from the regularized incomplete beta function, so results match statistical software — and everything runs locally in your browser.

Frequently asked questions

Should I use the t or the z interval?
Use t when the standard deviation is estimated from the sample (almost always). Use z only when the population standard deviation is truly known or n is large enough that the two are practically identical — t and z already agree to about 1% by n ≈ 200.
How is the margin of error calculated?
Margin of error = critical value × standard error, where the standard error is s/√n and the critical value is the t (df = n − 1) or z quantile at (1 + confidence)/2 — e.g. 2.0639 for 95% with n = 25, giving 50 ± 4.13 for mean 50, s = 10.
What does a 95% confidence interval actually mean?
If you repeated the sampling many times and built an interval each time, about 95% of those intervals would contain the true population mean. It is a statement about the procedure, not a 95% probability for any single interval.
Which assumptions does this interval rely on?
Observations should be independent and either roughly normally distributed or numerous enough (commonly n ≥ 30) for the central limit theorem to make the sample mean approximately normal.

More tools