Confidence interval calculator
Confidence Interval Calculator — Accurate Confidence Range Estimator
Use this free Confidence Interval Calculator to find how confident you can be that your sample mean reflects the true population mean. The tool supports both Z-distribution (when population standard deviation σ is known) and t-distribution (when σ is unknown), letting you compute confidence intervals for 90%, 95%, and 99% levels.
What is a Confidence Interval?
A confidence interval (CI) is a range of values likely to contain the true population parameter. For example, a 95% CI of [48.3, 51.7] means we are 95% confident that the true population mean lies between 48.3 and 51.7. This interval reflects both the sample variability and the confidence level.
Confidence Interval Formulas
1. Z-based (σ known): CI = x̄ ± Z × (σ / √n)
2. t-based (σ unknown): CI = x̄ ± t × (s / √n)
Where:
- x̄ = sample mean
- σ = population standard deviation (if known)
- s = sample standard deviation (if σ unknown)
- n = sample size
- Z = Z critical value (from standard normal distribution)
- t = t critical value (depends on degrees of freedom = n − 1)
How to Use This Calculator
- Enter your sample mean, standard deviation (σ or s), and sample size (n).
- Select the confidence level (90%, 95%, or 99%).
- Choose the distribution type — Z (known σ) or t (unknown σ).
- Click Calculate to view the margin of error and full confidence interval.
- Review the interpretation guide below to understand your results.
Example Calculation
Suppose your sample mean is 50, sample standard deviation is 4, and n = 25, with a 95% confidence level (t = 2.064). The standard error = 4 / √25 = 0.8. Margin of error = 2.064 × 0.8 = 1.651. So, the confidence interval is: 50 ± 1.651 → [48.35, 51.65]. We can be 95% confident that the true population mean lies between 48.35 and 51.65.
Interpretation of Confidence Levels
- 90% — smaller interval, less confidence, more precision.
- 95% — standard choice for most studies and research.
- 99% — wider interval, more confidence but less precision.
When to Use Z vs. t Distribution
- Z-distribution: use if population standard deviation (σ) is known and n ≥ 30.
- t-distribution: use if σ is unknown or n < 30 (small sample).
Related Concepts
- Standard Error (SE) — measures variability of sample mean.
- Central Limit Theorem — explains why normal distribution applies.
- Confidence Interval — Wikipedia
- Statology — Confidence Interval Formula Explained
FAQ — Confidence Interval Explained
1. What is a confidence interval?
A confidence interval is a range that estimates where the true population mean lies, based on sample data and chosen confidence level.
2. What is the margin of error?
The margin of error represents how much the sample estimate can vary from the true population value.
3. When should I use the Z formula?
Use the Z formula when the population standard deviation is known and your sample size is 30 or more.
4. When should I use the t formula?
Use the t formula when the population standard deviation is unknown or your sample size is small (less than 30).
5. What affects the width of the confidence interval?
Larger sample sizes and smaller standard deviations lead to narrower intervals; higher confidence levels make intervals wider.