Confidence interval calculator
This tool uses the normal (z) approximation. For small samples under about 30 observations the t-distribution is the correct choice, and this tool does not implement it; a warning appears instead.
Show the step-by-step calculation
Confidence Interval Calculator
A confidence interval turns a sample mean into a range of plausible values for the true population mean: mean plus or minus z times SD over the square root of n.
The formula is CI = mean +/- z * SD / sqrt(n). The standard deviation divided by the square root of the sample size is the standard error of the mean, and multiplying it by a z value sets the width: 1.6449 for 90 percent confidence, 1.9600 for 95 percent, and 2.5758 for 99 percent. Larger samples shrink the standard error and tighten the interval. Higher confidence widens it, because claiming to be right more often requires a broader net.
This calculator uses the normal approximation honestly. It is appropriate when the data are roughly normal or when n is large enough, conventionally 30 or more, for the central limit theorem to apply. For small samples the correct multiplier comes from the t-distribution, which this tool does not implement; it prints a clear warning whenever n falls below 30. The z multipliers are the same standard normal quantiles listed on the z-score calculator page. Need the standard deviation from raw data first? The standard deviation solver computes both sample and population versions.
Everything runs in your browser with plain JavaScript. Your numbers are never uploaded, stored, or logged.
Worked example
A sample of 25 measurements has a mean of 50 and a standard deviation of 10. What is the 95 percent confidence interval for the population mean?
Step 1, compute the standard error: SE = 10 / sqrt(25) = 10 / 5 = 2.
Step 2, multiply by the 95 percent z value: margin of error = 1.9600 * 2 = 3.92.
Step 3, subtract and add the margin around the mean: 50 - 3.92 = 46.08 and 50 + 3.92 = 53.92. The 95 percent confidence interval is 46.08 to 53.92, written as 50 plus or minus 3.92. Because n is 25, below the usual threshold of 30, the calculator also warns that a t-distribution interval would be slightly wider and more honest for this sample size. Enter the same four values above to reproduce the result and the warning.
Frequently asked questions
What does a 95 percent confidence interval mean?
It describes the reliability of the procedure, not a probability about one specific interval. If you repeated the same sampling process many times and built a 95 percent interval each time, about 95 percent of those intervals would contain the true population mean. Any single interval either contains the true mean or it does not; the 95 percent refers to the long-run success rate of the method.
Why does the interval get narrower as the sample size grows?
The margin of error is z times SD divided by the square root of n. Because n sits under a square root in the denominator, quadrupling the sample size halves the margin of error. Larger samples pin down the mean more precisely, but with diminishing returns: going from 25 to 100 observations halves the width, while going from 100 to 125 barely changes it.
What if my sample size is small?
With small samples, conventionally under about 30 observations, the z-based interval is too optimistic because the sample standard deviation is an unreliable estimate of the true spread. The correct approach uses the t-distribution, which has heavier tails and produces wider intervals. This calculator does not implement the t-distribution and prints a warning whenever n is below 30.
What assumptions does this calculator make?
It uses the normal approximation: either the underlying data are approximately normal, or the sample size is large enough (commonly 30 or more) for the central limit theorem to make the sampling distribution of the mean approximately normal. It also assumes the observations are independent and that the standard deviation you supply is a reasonable estimate of the population spread.
Which z values are used for each confidence level?
90 percent uses 1.6449, 95 percent uses 1.9600, and 99 percent uses 2.5758. These are the standard normal quantiles that leave 5, 2.5, and 0.5 percent in each tail respectively. Higher confidence always produces a wider interval because the multiplier grows.
Should I use the sample or population standard deviation here?
Use the standard deviation that matches how your data were gathered. For sample data intended to generalize, that is the sample standard deviation, which divides by n - 1. The standard deviation solver homepage computes both, and the sample versus population guide explains the choice in detail.