The Confidence Interval Calculator finds the confidence interval for a population mean from your sample size, sample mean, standard deviation, and confidence level. Enter your values below and click Calculate.
The confidence interval calculator computes the range within which the true population mean is likely to fall, based on a sample you have collected. By entering the sample size, the sample mean, the standard deviation, and your chosen confidence level, you instantly get the confidence interval - the margin of error and the lower and upper bounds around your estimate. Confidence intervals are one of the most important tools in statistics because they communicate not just a single estimate, but how precise and reliable that estimate is.
Whether you are analyzing survey results, scientific measurements, quality-control data, A/B test outcomes, or any sample drawn from a larger population, this calculator turns your summary statistics into a clear, interpretable interval.
A confidence interval is a range of values, derived from sample data, that is likely to contain the value of an unknown population parameter - most commonly the population mean. Instead of reporting a single number (a point estimate) such as "the average is 20.6," a confidence interval reports a range such as "the average is between 19.7 and 21.5," along with a confidence level that quantifies how reliable that range is.
The confidence level - such as 90%, 95%, or 99% - indicates the long-run reliability of the method. A 95% confidence interval means that if you repeated your sampling process many times and computed an interval each time, about 95% of those intervals would contain the true population mean. It does not mean there is a 95% probability that the true mean lies in your one specific interval; the true mean is fixed, and it is the interval that varies from sample to sample.
This calculator uses the standard formula for a confidence interval of the mean based on the normal (z) distribution:
CI = X̄ ± Z × (s ÷ √n)
Where X̄ is the sample mean, Z is the z-score (critical value) corresponding to your confidence level, s is the standard deviation, and n is the sample size. The term s ÷ √n is the standard error of the mean, and Z × (s ÷ √n) is the margin of error.
Example: With a sample size of 50, a sample mean of 20.6, a standard deviation of 3.2, and a 95% confidence level (Z = 1.9600), the margin of error is 1.9600 × (3.2 ÷ √50) = 0.887. The confidence interval is therefore 20.6 ± 0.887, or [19.713, 21.487] - meaning we are 95% confident the true population mean lies between about 19.71 and 21.49.
The z-score is the number of standard errors you extend on each side of the mean to achieve your desired confidence level. Higher confidence requires a wider interval and therefore a larger z-score. The most commonly used critical values are:
| Confidence Level | Z-Score |
|---|---|
| 80% | 1.282 |
| 90% | 1.645 |
| 95% | 1.960 |
| 98% | 2.326 |
| 99% | 2.576 |
| 99.9% | 3.291 |
This calculator accepts any confidence level you enter and computes the exact critical value using the inverse of the standard normal distribution, so you are not limited to the common levels above.
The number of observations in your sample. Sample size has a powerful effect on precision: because the standard error divides by the square root of n, quadrupling your sample size halves the margin of error. Larger samples produce narrower, more precise intervals.
The average of your sample observations. It is the point estimate at the center of the confidence interval - the single best guess for the population mean before accounting for uncertainty.
A measure of how spread out the data is. A larger standard deviation means more variability in the data, which widens the confidence interval. Use the population standard deviation (σ) if known, or the sample standard deviation (s) as an estimate.
The probability that the method captures the true parameter over repeated sampling, typically 90%, 95%, or 99%. A higher confidence level produces a wider interval, because being more certain of capturing the true mean requires casting a wider net.
The margin of error is the "±" part of the confidence interval - how far the interval extends on each side of the sample mean. It is calculated as the z-score times the standard error:
Margin of Error = Z × (s ÷ √n)
A smaller margin of error means a more precise estimate. Three factors shrink the margin of error: a larger sample size, a smaller standard deviation, and a lower confidence level. Pollsters and researchers constantly balance these trade-offs - especially sample size against cost - to achieve an acceptable margin of error.
There is an inherent trade-off between confidence and precision: you can be very confident about a wide range, or less confident about a narrow range, but you cannot be both highly confident and highly precise without collecting more data.
Suppose a 95% confidence interval for average customer spending is [$45, $55]. The correct interpretation is: "We are 95% confident that the true average customer spending in the population is between $45 and $55." This reflects confidence in the method - over many repeated samples, 95% of the intervals constructed this way would contain the true mean.
A common mistake is to say there is a 95% chance the true mean falls within this specific interval. In classical (frequentist) statistics, the true mean is a fixed but unknown constant - it is either in the interval or it is not. The 95% refers to the reliability of the procedure across many samples, not to a single interval.
Another useful interpretation involves comparison: if a confidence interval for a difference between two groups does not include zero, the difference is statistically significant at the corresponding level. Confidence intervals and hypothesis tests are two sides of the same coin.
This calculator uses the z-distribution, which is appropriate when the population standard deviation is known or when the sample size is large (commonly n ≥ 30), so that the sample standard deviation is a reliable estimate. For small samples (n < 30) drawn from a normal population with an unknown standard deviation, statisticians often use the Student's t-distribution instead, which produces slightly wider intervals to account for the extra uncertainty in estimating the standard deviation from a small sample. As the sample size grows, the t-distribution converges to the z-distribution, and the two give nearly identical results.
It means that if you repeated your sampling and interval-building process many times, about 95% of the resulting intervals would contain the true population mean. It expresses confidence in the method, not the probability that the true mean lies in one particular interval.
Increase the sample size, reduce variability in the data, or lower the confidence level. Increasing the sample size is the most reliable approach, since the margin of error shrinks with the square root of n.
The margin of error is the amount added and subtracted from the sample mean to form the interval. It equals the z-score times the standard error (the standard deviation divided by the square root of the sample size).
Use the z-distribution when the population standard deviation is known or the sample is large (n ≥ 30). Use the t-distribution for small samples from a normal population with an unknown standard deviation. This calculator uses the z-distribution.
Not exactly - a higher confidence level makes you more certain of capturing the true mean, but it widens the interval, making the estimate less precise. There is always a trade-off between confidence and precision for a fixed sample size.
Yes. If a confidence interval for a difference between groups does not contain zero, the difference is statistically significant at the corresponding level. Confidence intervals and hypothesis tests are closely related.