Confidence Interval Calculator

Calculate a confidence interval for a sample mean, at 90%, 95%, or 99% confidence.

How this is calculated

The standard error is your standard deviation divided by the square root of your sample size. The margin of error multiplies that standard error by the z-critical value for your chosen confidence level (1.645 for 90%, 1.96 for 95%, 2.576 for 99%). The interval is your sample mean plus or minus that margin of error.

With this calculator's defaults — a sample mean of 50, standard deviation 10, sample size 100 — the standard error is 10 / √100 = 1, so the 95% interval is 50 ± (1.96 × 1) = 48.04 to 51.96. Widening the confidence level to 99% widens that same interval to roughly 47.42 to 52.58, illustrating the direct trade-off between how confident you are and how precise the range is. This same standard-error logic underlies comparing two groups' results — see the A/B Test calculator for testing whether two observed rates differ significantly, and the Sample Size calculator for working out how large a sample you need before collecting data.

Frequently asked questions

What is a confidence interval?
A range of values that's likely to contain the true population mean, based on your sample. A 95% confidence interval means that if you repeated the sampling process many times, about 95% of the intervals you'd calculate would contain the true population mean.
Why does a higher confidence level give a wider interval?
To be more certain the interval captures the true mean, it has to cover a wider range — there's a direct trade-off between confidence and precision. A 99% interval is wider than a 95% interval for the same data.
How does sample size affect the interval?
Larger samples produce narrower (more precise) intervals, because the standard error — standard deviation divided by the square root of sample size — shrinks as sample size grows.
Does this assume the data is normally distributed?
This uses the standard z-interval, which assumes a known or well-estimated standard deviation and relies on the Central Limit Theorem — a good approximation for most reasonably sized samples (typically n ≥ 30), even if the underlying data isn't perfectly normal.
Can I use this in my own app?
Yes — every calculator on Stupidly Clever has a matching REST API and MCP tool that runs the same underlying logic.
What is the most common misconception about confidence intervals?
The most common error is saying "there's a 95% probability the true value lies in this interval." Strictly speaking, the true value is fixed — it's either in the interval or it isn't. The 95% refers to the method: if you repeated the study many times, 95% of the intervals constructed this way would contain the true value.
What is the difference between a confidence interval and a credible interval?
A confidence interval is a frequentist concept based on repeated sampling. A credible interval (from Bayesian statistics) directly expresses the probability that the parameter lies within the range, given your prior beliefs and observed data. For most practical A/B testing and polling contexts, they give similar results, but they answer subtly different questions.

Related calculators