What Is a Confidence Interval?
A confidence interval (CI) is a range of plausible values for a population parameter, built from a sample estimate plus and minus a margin of error.
A 95% confidence interval for a mean of [30.45, 34.35] minutes means the method used to build it captures the true mean in 95% of repeated samples. Jerzy Neyman formalized confidence intervals in 1937. Every interval has 3 parts: the point estimate, the critical value and the standard error. Test a mean or proportion against a value with the Z Test Calculator.
Confidence Interval Formulas
There are 4 common confidence interval formulas.
For a Mean (σ Known: z)
Use the z interval when the population standard deviation is known. z* = 1.96 at 95% confidence.
For a Mean (σ Unknown: t)
Use the t interval when σ is estimated by the sample standard deviation s. t* comes from the t distribution with n − 1 degrees of freedom: 2.023 for n = 40 at 95%.
For a Proportion
This is the Wald interval. The Wilson score interval, proposed by Edwin B. Wilson in 1927, performs better when n is small or p̂ is close to 0 or 1.
For a Difference Between Two Means or Proportions
A difference interval uses the same pattern with a combined standard error:
- Two means (σ known): (x̄₁ − x̄₂) ± z* × √(σ₁²/n₁ + σ₂²/n₂)
- Two proportions: (p̂₁ − p̂₂) ± z* × √(p̂₁(1 − p̂₁)/n₁ + p̂₂(1 − p̂₂)/n₂)
Get difference intervals alongside the test with the two sample z test calculator.
How to Use the Confidence Interval Calculator
To use the confidence interval calculator, follow 3 steps:
- Choose what you estimate: a mean with σ unknown (t), a mean with σ known (z) or a proportion.
- Enter x̄, s or σ and n, or the successes and n for a proportion.
- Enter the confidence level (or α), or click a preset.
The chart stacks the intervals at 80%, 90%, 95%, 99% and 99.9% around the estimate, with your level highlighted, so the cost of extra confidence is visible. The cards show the interval, the margin of error, the critical value and the standard error.
Choosing a Confidence Level (90%, 95%, 99%)
95% is the standard confidence level, 90% gives a narrower interval with less confidence and 99% gives a wider interval with more confidence.
| Confidence level | z* | Width relative to 95% |
|---|---|---|
| 90% | 1.645 | 0.84× |
| 95% | 1.960 | 1.00× |
| 99% | 2.576 | 1.31× |
How to Interpret a Confidence Interval
Interpret a 95% CI as "the method captures the true value in 95% of samples", not as "a 95% probability that this interval holds the true value". The interval either contains the true value or it does not. A narrow interval means a precise estimate, and a wide interval means more uncertainty, usually from a small sample.
Confidence Interval Examples
There are 2 worked examples below.
Example 1: Average Delivery Time
40 deliveries have x̄ = 32.4 minutes and s = 6.1 minutes. Find the 95% CI for the mean.
- Standard errorSE = 6.1 / √40 = 0.9645
- Critical valuet* (df = 39) = 2.023
- Margin of error2.023 × 0.9645 = 1.951 minutes
- 95% CI32.4 ± 1.951 = [30.45, 34.35] minutes
Example 2: Survey Approval Rate
540 of 1,000 respondents approve of a policy. Find the 95% CI for the approval rate.
- Sample proportionp̂ = 0.54
- Standard errorSE = √(0.54 × 0.46 / 1000) = 0.0158
- Margin of error1.96 × 0.0158 = 0.0309 (3.1 points)
- 95% CI[0.509, 0.571], or 50.9% to 57.1%
Confidence Intervals and Hypothesis Tests
A two-sided 95% confidence interval and a two-tailed test at α = 0.05 always agree: the test rejects H₀ exactly when the interval excludes the hypothesized value. The approval interval [50.9%, 57.1%] excludes 50%, so a test of H₀: p = 0.5 rejects at α = 0.05. Test a single proportion directly with the one proportion z test calculator.
Margin of Error Explained
The margin of error is half the width of the confidence interval, z* (or t*) times the standard error. A poll reported as 54% ± 3.1% has a margin of error of 3.1 points. Calculate margins for surveys, including a finite population correction, with the margin of error calculator.
FAQs
Does a 95% CI mean there is a 95% chance the true value is inside it?
No, a 95% CI does not mean a 95% chance that the true value lies inside this particular interval. The 95% describes the method: across many samples, 95% of the intervals built this way capture the true value. Bayesian credible intervals are the tool that gives a direct probability statement.
Why does a bigger sample make the interval narrower?
A bigger sample makes the interval narrower, since the standard error falls with √n. Quadrupling the sample halves the margin of error: n = 100 to n = 400 cuts a margin of 4 to 2. Find the n for a target width with the sample size calculator.
What if my interval includes zero?
An interval for a difference that includes zero means the data do not show a difference at that confidence level. A 95% CI of [−0.71, 7.71] for a difference in means matches a non-significant two-tailed test at α = 0.05.
Can a confidence interval for a proportion go below 0 or above 1?
Yes, the Wald interval can go below 0 or above 1 for small samples or proportions near the edges. 1 success in 20 gives p̂ = 0.05 and a Wald interval of [−0.046, 0.146]. Use the Wilson interval, which stays inside [0, 1], in these cases.
How do I report a confidence interval in APA format?
Report a confidence interval as 95% CI [lower, upper] after the estimate. Example: "The mean delivery time was 32.4 minutes, 95% CI [30.45, 34.35]." Look up z* and t* for other levels with the critical value calculator.