Confidence Interval for Difference of Means
Build a confidence interval for the difference between two population means from each sample’s mean, standard deviation and size, using the pooled Student-t method.
How it works
s²ₚ = [(n₁−1)s₁² + (n₂−1)s₂²] ÷ (n₁+n₂−2) · CI = (x̄₁ − x̄₂) ± t* · √(s²ₚ(1/n₁ + 1/n₂))
This interval estimates how large the gap between two population means might be, rather than only testing whether it is zero. It pools the two sample variances, scales by the pooled standard error, and widens the interval with a Student-t critical value that accounts for the sample sizes. If the resulting interval does not contain zero, the difference is significant at the matching confidence level.
Worked example
Two samples of 30 have means 52 and 47 with standard deviations 8 and 9. The pooled SD is about 8.5, the standard error ≈ 2.19, df = 58, and t* ≈ 2.00 for 95%. The interval is 5 ± 4.39 → 0.61 to 9.39 — it excludes zero, so the means differ.
Sources: Confidence interval — Wikipedia
Frequently asked questions
What does "the interval excludes zero" mean?
If the whole interval is above or below zero, you can be confident (at the stated level) that the two means genuinely differ. If it straddles zero, the data are consistent with no real difference.
Why use t* rather than z?
Because the population standard deviations are unknown and estimated from the samples, the Student-t distribution accounts for that extra uncertainty. For large samples t* is very close to the z value (1.96 at 95%).
Does this assume equal variances?
Yes — it is the pooled interval, which assumes the two populations share one variance. When variances clearly differ, a Welch-style interval with a fractional degrees-of-freedom formula is more appropriate.
Related calculators
For education — confirm the test assumptions (independence, sample size, roughly normal data) before drawing conclusions from a p-value.