All Tools

Confidence Interval Calculator

Select an interval type, enter your summary statistics, choose a confidence level, and get the confidence interval with margin of error, critical values, and a number line visualization. All calculations run in your browser.

%

Reference Guide

What is a Confidence Interval

A confidence interval gives a range of plausible values for a population parameter (like a mean or proportion) based on sample data. Instead of a single point estimate, it communicates the uncertainty in the estimate.

Interpretation "We are 95% confident the true mean falls between 48.04 and 51.96" means that if we repeated the sampling process many times, about 95% of the resulting intervals would contain the true mean.
Structure
point estimate±margin of error\text{point estimate} \pm \text{margin of error}

Higher confidence levels produce wider intervals. To narrow the interval without lowering confidence, increase the sample size.

Z-Interval vs T-Interval

Z-Interval Use when the population standard deviation σ\sigma is known. The critical value comes from the standard normal distribution.
xˉ±zσn\bar{x} \pm z^* \cdot \frac{\sigma}{\sqrt{n}}
T-Interval Use when σ\sigma is unknown and you estimate it with the sample standard deviation ss. The critical value comes from the t-distribution with df=n1df = n - 1.
xˉ±tsn\bar{x} \pm t^* \cdot \frac{s}{\sqrt{n}}

The t-interval is always wider than the z-interval for the same data because the t-distribution has heavier tails. As nn increases, the t-distribution approaches the standard normal and the two intervals converge.

Confidence Intervals for Proportions

When estimating a population proportion (like the fraction of voters who support a candidate), use the Wald interval formula.

Formula
p^±zp^(1p^)n\hat{p} \pm z^* \sqrt{\frac{\hat{p}(1 - \hat{p})}{n}}
Conditions The normal approximation is reliable when both np^10n\hat{p} \ge 10 and n(1p^)10n(1 - \hat{p}) \ge 10. If these conditions are not met, the interval may not be accurate.

The sample proportion p^\hat{p} is computed as the number of successes divided by the sample size.

Margin of Error and Sample Size

The margin of error is the distance from the point estimate to either endpoint of the confidence interval.

Formula
ME=zσnME = z^* \cdot \frac{\sigma}{\sqrt{n}}
Solving for sample size Rearranging the margin of error formula gives the minimum sample size needed for a desired precision.
n=(zσE)2n = \left(\frac{z^* \cdot \sigma}{E}\right)^2

Larger samples mean smaller margins of error. Doubling the precision (halving the margin of error) requires four times the sample size.