Confidence Interval Calculator
Get a confidence interval for a mean (t or z), a proportion (Wald, Wilson score, and Clopper–Pearson exact), or the difference between two means (Welch) at any confidence level — with the margin of error, the working, and a correct one-sentence interpretation. Free, no sign-up.
Results
60.8373 – 68.7627
95% confidence interval
64.8
Sample mean (x̄)
± 3.9627
Margin of error
1.92
Standard error
2.0639
t* on 24 df
How this was calculated
SE = s / √n = 9.6 / √25 = 1.92
x̄ ± t* × SE = 64.8 ± 2.0639 × 1.92 = 64.8 ± 3.9627
We are 95% confident that the population mean lies between 60.8373 and 68.7627. The 95% describes the method, not this one interval: if you drew many samples and built an interval from each, about 95% of those intervals would contain the true mean. This particular interval either contains it or it does not.
APA style
95% CI [60.84, 68.76]
How to Use the Confidence Interval Calculator
- 1. Choose what you are estimating. A single mean, a single proportion, or the difference between the means of two independent groups.
- 2. Enter your numbers. For a mean, type the mean, standard deviation and sample size — or paste the raw data. For a proportion, enter the number of successes and the sample size. For two means, enter each group's summary statistics.
- 3. Set the confidence level. 95% is the convention, but any level between 0 and 100 works: 90, 99, or 97.5.
- 4. Read the interval. You get the bounds, the margin of error, the standard error, the critical value, the working, a plain-language interpretation, and the interval in APA format to copy.
The Formulas
Every interval here has the same shape — estimate ± critical value × standard error — and they differ only in the standard error and in the distribution the critical value comes from.
| Interval | Formula | Critical value from |
|---|---|---|
| Mean, σ unknown | x̄ ± t* × s / √n | t with n − 1 df |
| Mean, σ known | x̄ ± z* × σ / √n | Standard normal |
| Proportion (Wald) | p̂ ± z* × √(p̂(1 − p̂) / n) | Standard normal |
| Proportion (Wilson score) | (p̂ + z²/2n ± z √(p̂(1 − p̂)/n + z²/4n²)) / (1 + z²/n) | Standard normal |
| Proportion (Clopper–Pearson) | Beta quantiles B(α/2; x, n − x + 1) and B(1 − α/2; x + 1, n − x) | Exact binomial |
| Two means (Welch) | (x̄₁ − x̄₂) ± t* × √(s₁²/n₁ + s₂²/n₂) | t with Welch–Satterthwaite df |
Use t whenever the standard deviation comes from your own sample, which is almost always. The z interval is for the rare case where the population SD is genuinely known, such as a standardised test with a published σ. For proportions, the Wilson score interval is the safe default: the Wald interval undercovers badly when n is small or p̂ is near 0 or 1, and Clopper–Pearson guarantees at least the stated coverage, so it runs wide.
Worked Example and Interpretation
Twenty-five students score a mean of 64.8 with a standard deviation of 9.6. The standard error is 9.6 / √25 = 1.92, the critical value for 95% confidence on 24 df is t* = 2.0639, and the margin of error is 2.0639 × 1.92 = 3.9627. The interval runs from 60.8373 to 68.7627 — in APA style, 95% CI [60.84, 68.76].
The correct reading is: we are 95% confident that the population mean lies between 60.84 and 68.76. The 95% belongs to the method, not to this interval: if you repeated the study many times, about 95% of the intervals built this way would contain the true mean, and any single interval either contains it or does not. "There is a 95% probability that the true mean is in this interval" is the most common misreading.
For a proportion, 42 successes out of 120 give p̂ = 0.35 and a 95% Wilson interval of 0.2705 to 0.4388 (Clopper–Pearson 0.2652 to 0.4424; Wald 0.2647 to 0.4353). For two groups — a mean of 78.2 (SD 10.5, n = 30) against 72.6 (SD 12.8, n = 28) — the difference of 5.6 has a Welch 95% interval from −0.59 to 11.79 on 52.34 df. It includes 0, so the difference is not statistically significant at α = .05, even though the point estimate looks sizeable.
Common mistakes
- Using z with a sample SD. With n = 25, z* = 1.96 in place of t* = 2.064 makes the interval about 5% too narrow, and the gap grows as n shrinks.
- Reading overlapping intervals as "no difference". Two 95% intervals can overlap while the difference between the groups is still significant. Compute the interval for the difference instead.
- Reporting the Wald interval for small samples. With 2 successes in 25 trials the Wald lower bound falls below zero; the Wilson interval, 0.0222 to 0.2497, stays inside 0 to 1.
- Assuming more confidence is better. Higher confidence buys a wider interval: the same exam scores give 59.43 to 70.17 at 99%. Only a larger sample makes an interval both confident and narrow.
Frequently Asked Questions
- What is a confidence interval?
- A range of plausible values for a population parameter — a mean, a proportion, a difference — computed from a sample. It is built so that, over many repeated samples, a stated share of such intervals (the confidence level, often 95%) would contain the true value. Its width shows how precisely the sample pins the parameter down.
- How do I calculate a 95% confidence interval for a mean?
- Add and subtract the critical value times the standard error: x̄ ± t* × s / √n, where t* is the 97.5th percentile of the t distribution with n − 1 degrees of freedom (2.064 for n = 25). The calculator does each step and shows the working, or computes the mean and SD for you from raw data.
- What is the difference between a confidence interval and the margin of error?
- The margin of error is half the width of the interval: critical value × standard error. The interval is the estimate plus and minus that margin. 42 successes out of 120 is 35% with a 95% Wald margin of 8.5 percentage points, so the interval runs from about 26.5% to 43.5%.
- Should I use the Wilson or the Clopper–Pearson interval for a proportion?
- Wilson for most purposes: its coverage stays close to the stated level even for small samples and extreme proportions, and it is the interval most statisticians now recommend in place of Wald. Clopper–Pearson guarantees at least the stated coverage, so it is wider; use it when a protocol or regulator asks for an exact interval.
- Why is a 99% confidence interval wider than a 95% one?
- To capture the true value more often, the interval has to cover more ground. For 24 df the critical t rises from 2.064 to 2.797, so the margin of error grows by about 36%. The only way to be more confident and just as precise is a larger sample.
- Can I get a confidence interval for paired data?
- Yes. Subtract each pair (after − before, say), paste the differences into the raw-data option for a mean, and the result is the confidence interval for the mean difference. The two-means option assumes two independent groups, so do not use it for paired measurements.