Confidence Interval Calculator
Calculate confidence intervals for population means (known or unknown σ) and proportions. Find the margin of error, critical values, and interval bounds. Related tools: Margin of Error Calculator, Sample Size Calculator, and Standard Error Calculator.
How to Use the Confidence Interval Calculator
A confidence interval provides a range of plausible values for a population parameter based on sample data. This calculator supports three scenarios: estimating a population mean when σ is known (z-interval), estimating a mean when σ is unknown (t-interval), and estimating a population proportion (Wald interval).
Select the appropriate interval type, enter your sample statistics (mean or proportion, standard deviation, and sample size), and choose a confidence level (commonly 90%, 95%, or 99%). The calculator returns the confidence interval bounds, margin of error, critical value, and standard error.
The confidence level represents the long-run proportion of intervals that would contain the true parameter if the sampling were repeated many times. A 95% CI does NOT mean there is a 95% probability the parameter is in this specific interval — the parameter is fixed, and the interval either contains it or does not. Higher confidence levels produce wider intervals.
Formula
Mean (σ known — Z-interval):
CI = x̄ ± z*(α/2) × (σ / √n)
Mean (σ unknown — t-interval):
CI = x̄ ± t*(α/2, n-1) × (s / √n)
Proportion (Wald interval):
CI = p̂ ± z*(α/2) × √(p̂(1-p̂)/n)
Margin of Error:
E = critical value × standard error
Standard Error:
SE(mean) = σ/√n or s/√n
SE(proportion) = √(p̂(1-p̂)/n)
Example Calculation
A sample of 40 students has mean score 72.5 with s = 8.3. Find the 95% CI for the population mean:
Given: x̄ = 72.5, s = 8.3, n = 40, confidence = 95%
Method: t-interval (σ unknown)
df = 40 - 1 = 39
t*(0.025, 39) ≈ 2.023
SE = 8.3 / √40 = 8.3 / 6.325 = 1.3124
Margin of Error = 2.023 × 1.3124 = 2.655
CI = [72.5 - 2.655, 72.5 + 2.655]
95% CI: [69.845, 75.155]
We are 95% confident the population mean is between 69.8 and 75.2.
Critical Values Reference Table (z* and t*)
| Confidence | z* | t* (df=10) | t* (df=20) | t* (df=30) |
|---|---|---|---|---|
| 80% | 1.282 | 1.372 | 1.325 | 1.310 |
| 90% | 1.645 | 1.812 | 1.725 | 1.697 |
| 95% | 1.960 | 2.228 | 2.086 | 2.042 |
| 98% | 2.326 | 2.764 | 2.528 | 2.457 |
| 99% | 2.576 | 3.169 | 2.845 | 2.750 |
| 99.5% | 2.807 | 3.581 | 3.153 | 3.030 |
| 99.9% | 3.291 | 4.587 | 3.850 | 3.646 |
Frequently Asked Questions
What is a confidence interval?
A confidence interval is a range of values that is likely to contain the true population parameter. It is constructed from sample data and has an associated confidence level (e.g., 95%). The interval provides more information than a point estimate alone because it communicates the precision of the estimate. Wider intervals indicate less precision; narrower intervals indicate more precision.
What does 95% confidence actually mean?
A 95% confidence level means that if you repeated the sampling process many times and constructed a CI each time, approximately 95% of those intervals would contain the true population parameter. It does NOT mean there is a 95% probability that this particular interval contains the parameter. The parameter is a fixed (unknown) value — it is either in the interval or it is not.
When should I use a z-interval vs a t-interval?
Use a z-interval when the population standard deviation σ is known (rare in practice). Use a t-interval when σ is unknown and estimated by the sample standard deviation s (the common case). The t-interval produces wider intervals to account for the additional uncertainty in estimating σ. As sample size increases, the t-interval approaches the z-interval because t* approaches z*.
How does sample size affect the confidence interval?
Larger sample sizes produce narrower confidence intervals because the standard error (σ/√n or s/√n) decreases as n increases. Specifically, to halve the width of a CI, you need to quadruple the sample size (since width is proportional to 1/√n). This is why researchers perform power analysis and sample size calculations before collecting data — to ensure the CI will be narrow enough to be useful.
What is the margin of error?
The margin of error (E) is half the width of the confidence interval. It equals the critical value multiplied by the standard error: E = z* × SE or E = t* × SE. The CI is then [estimate - E, estimate + E]. In polling, the margin of error is typically reported at 95% confidence. A ±3% margin of error means the true proportion is within 3 percentage points of the reported value with 95% confidence.
What assumptions are required for confidence intervals?
For means: (1) random sampling, (2) independence of observations, (3) approximately normal population or large sample (n ≥ 30 by CLT). For proportions: (1) random sampling, (2) independence, (3) np̂ ≥ 10 and n(1-p̂) ≥ 10 for the normal approximation. If assumptions are violated, consider bootstrap confidence intervals or non-parametric methods as alternatives.