# Confidence Interval Calculator

URL: https://hifreetools.com/calculators/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.

## 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

- CI = x̄ ± Z·(s / √n)

## Examples

- Default — 95% interval for a mean: Mean = 100, s = 15, n = 30, confidence = 95% → Margin = 5.36768, CI = 94.6323 to 105.368
- Wider sample, 90% confidence: Mean = 50, s = 10, n = 100, confidence = 90% → Margin = 1.645, CI = 48.355 to 51.645
- 99% confidence (more certainty, wider interval): Mean = 500, s = 80, n = 64, confidence = 99% → Margin = 25.76, CI = 474.24 to 525.76
- Small lab sample at 99%: Mean = 75, s = 12, n = 49, confidence = 99% → Margin = 4.416, CI = 70.584 to 79.416

## FAQ

**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 wider interval (much wider for very small n).

**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

- [Wikipedia — Confidence interval](https://en.wikipedia.org/wiki/Confidence_interval)
- [NIST/SEMATECH e-Handbook of Statistical Methods — Confidence Limits for the Mean](https://www.itl.nist.gov/div898/handbook/eda/section3/eda352.htm)

Runs in the browser; nothing is uploaded. Cite as: HIFreeTools, "Confidence Interval Calculator", https://hifreetools.com/calculators/confidence-interval-calculator
