Free Confidence Interval Calculator
Compute a z-based confidence interval for a population mean from your sample mean, standard deviation, and sample size. Instantly see the margin of error and the lower and upper bounds at the 90%, 95%, or 99% confidence level.
Enter your sample statistics to find the z-based confidence interval for the mean.
CI = x̄ ± Z·(s/√n) with Z = 1.96. We are 95% confident the true population mean lies in this range.
Quick answer
A confidence interval for a mean is calculated as CI = x̄ ± Z·(s/√n), where the margin of error equals Z·(s/√n). The Z value comes from your confidence level: 1.645 for 90%, 1.96 for 95%, and 2.576 for 99%. For example, a sample mean of 100 with s = 15 and n = 30 at 95% gives a margin of about 5.37 and an interval of roughly 94.63 to 105.37.
Formula & method
CI = x̄ ± Z·(s / √n)
- x̄ — Sample mean (the center of the interval)
- s — Sample standard deviation
- n — Sample size (number of observations)
- Z — Critical z value: 1.645 (90%), 1.96 (95%), 2.576 (99%)
- s/√n — Standard error of the mean
The margin of error is Z·(s/√n); subtract it from the mean for the lower bound and add it for the upper bound. This z-based form assumes a roughly normal sampling distribution, which holds when n is large (commonly n ≥ 30) or the population is normal.
Examples
- Input
- Mean = 100, s = 15, n = 30, confidence = 95%
- Result
- Margin = 5.36768, CI = 94.6323 to 105.368
- Why
- Standard error = 15/√30 = 15/5.47723 = 2.73861. Margin = 1.96 × 2.73861 = 5.36768. Lower = 100 − 5.36768 = 94.6323; upper = 100 + 5.36768 = 105.368.
- Input
- Mean = 50, s = 10, n = 100, confidence = 90%
- Result
- Margin = 1.645, CI = 48.355 to 51.645
- Why
- Standard error = 10/√100 = 10/10 = 1. Margin = 1.645 × 1 = 1.645. Lower = 50 − 1.645 = 48.355; upper = 50 + 1.645 = 51.645. The larger n shrinks the standard error and narrows the interval.
- Input
- Mean = 500, s = 80, n = 64, confidence = 99%
- Result
- Margin = 25.76, CI = 474.24 to 525.76
- Why
- Standard error = 80/√64 = 80/8 = 10. Margin = 2.576 × 10 = 25.76. Lower = 500 − 25.76 = 474.24; upper = 500 + 25.76 = 525.76. Raising confidence from 95% to 99% widens the interval because Z grows from 1.96 to 2.576.
- Input
- Mean = 75, s = 12, n = 49, confidence = 99%
- Result
- Margin = 4.416, CI = 70.584 to 79.416
- Why
- Standard error = 12/√49 = 12/7 = 1.71429. Margin = 2.576 × 1.71429 = 4.416. Lower = 75 − 4.416 = 70.584; upper = 75 + 4.416 = 79.416.
When to use this tool
- Estimating a population mean (average) from a sample and reporting a plausible range rather than a single point estimate.
- Reporting survey, lab, or A/B-test results where you need to state precision, e.g. 'average = 100, 95% CI 94.6 to 105.4'.
- Comparing how the interval width changes as you raise the confidence level (90% → 95% → 99%) or increase the sample size.
- Quick textbook or homework checks for z-based confidence intervals when the standard deviation is known or the sample is large.
Common mistakes
- Dividing s by n instead of by √n. The standard error is s/√n, not s/n — forgetting the square root makes the interval far too narrow.
- Using the standard deviation s in place of the standard error. The margin of error scales the standard error (s/√n), not s itself.
- Confusing the confidence level with the Z value. 95% confidence corresponds to Z = 1.96, not Z = 95 or Z = 0.95.
- Applying the z-based formula to a tiny sample with unknown population variance. For small n (under about 30) you should use a t critical value instead of a fixed Z.
Frequently asked questions
What does a 95% confidence interval actually mean?
It means that if you repeated the sampling many times and built an interval each time using this method, about 95% of those intervals would contain the true population mean. It is a statement about the long-run reliability of the procedure, not the probability that this one specific interval contains the mean.
Which Z value goes with each confidence level?
This calculator uses the standard two-sided critical values: Z = 1.645 for 90% confidence, Z = 1.96 for 95%, and Z = 2.576 for 99%. Higher confidence uses a larger Z, which produces a wider interval.
Should I use a Z value or a t value?
Use Z (as here) when the population standard deviation is known or the sample is large (commonly n ≥ 30), so the sample standard deviation is a reliable estimate. For small samples with an unknown population standard deviation, use the t distribution with n − 1 degrees of freedom, which gives a slightly wider interval.
How do I make a confidence interval narrower?
Increase the sample size n, since the standard error s/√n shrinks as n grows. You can also lower the confidence level (for example from 99% to 90%), which uses a smaller Z, or reduce variability in the data so s is smaller.
What is the margin of error in a confidence interval?
The margin of error is the half-width of the interval: Z·(s/√n). You subtract it from the sample mean for the lower bound and add it for the upper bound, so the full interval is mean ± margin of error.
Why does a higher confidence level give a wider interval?
To be more confident that the interval captures the true mean, you must cover a larger range of plausible values. That requires a larger critical Z value (1.96 at 95% versus 2.576 at 99%), which multiplies the standard error by a bigger factor and widens the interval.
Sources & references
- Wikipedia — Confidence interval
- NIST/SEMATECH e-Handbook of Statistical Methods — Confidence Limits for the Mean
External references open in a new tab. We are independent and not affiliated with these organizations.
- ✓ Free to use
- ✓ No sign-up required
- ✓ Runs entirely in your browser — nothing is uploaded.
- ✓ Formula and method shown above
Provided “as is” for general information only — results may be inaccurate, so verify before you rely on them. No warranty; use at your own risk.
Built and reviewed by HIFreeTools against the formula shown above and any authoritative references cited on this page. See our methodology and editorial standards.
Related tools
- Standard Deviation CalculatorCalculators
- Sample Size CalculatorCalculators
- Z-Score CalculatorCalculators
- Mean Median Mode CalculatorCalculators
- Average CalculatorCalculators
Embed this tool on your site
Free to embed, no sign-up. Paste this code where you want the confidence interval calculator to appear: