Difference of Means Confidence Interval Calculator

Enter the mean, SD and size of each sample.

How it is calculated

The difference is d = mean₁ − mean₂. Its standard error combines the spread of both groups: SE = √(sd₁²/n₁ + sd₂²/n₂). The interval is d ± z × SE, with z fixed at 1.645 for 90 percent, 1.96 for 95 percent and 2.576 for 99 percent confidence. The confidence field accepts only 90, 95 or 99 (blank means 95); any other value, such as 80, shows no result. Results are shown to four decimals.

The tool uses these normal-distribution (z) values, not Student's t, so with small samples the true interval is wider than shown: roughly 45% wider at 3 per group. It assumes two independent groups, takes each SD as a sample standard deviation (not negative), and needs each group size to be at least 2.

Worked example

Group 1 has mean 52.4, SD 8.1 and 40 observations; group 2 has mean 48.9, SD 9.3 and 45 observations. The difference is 52.4 − 48.9 = 3.5, shown as 3.5000. Standard error: √(8.1²/40 + 9.3²/45) = √(1.640 + 1.922) = 1.887. At 95 percent the margin is 1.96 × 1.887 = 3.699. The interval is 3.5 ± 3.699, from -0.1993 to 7.1993. Because it includes 0, the data do not rule out no true difference at that level.

Try this example →

Common mistakes

  • Entering the standard error instead of the standard deviation. The SD describes spread among individuals; the tool computes the standard error itself, so using the SE would give an interval far too narrow.
  • Using it for paired data, such as before and after measurements on the same people. The formula assumes independent groups, so paired data need an interval on the within-pair differences.
  • Reading a 95 percent interval as a 95 percent chance that the true difference lies inside it for this particular study. It describes the long-run behaviour of the method, not the probability for one result.
  • Typing a confidence level such as 80 or 97 and expecting a result. Only 90, 95 and 99 are recognised; anything else leaves the result empty.
  • Concluding that no difference exists because the interval contains 0. It means the data are compatible with no difference, but equally compatible with differences up to the upper limit.

About this calculator

When comparing two groups — a treatment vs. control group, two product variants, two time periods — the raw difference between their sample means only tells half the story. A confidence interval for the difference of means quantifies the uncertainty around that gap, built from each group's mean, standard deviation, and sample size using the standard error of the difference.

This is a foundational technique in inferential statistics, used in A/B testing to decide whether an observed lift is likely real or just noise, in clinical trials to compare treatment effects, and in scientific research generally whenever two independent samples need to be compared rather than just eyeballed side by side.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    The width of the interval shrinks with the square root of the sample size, so to halve it you need about four times as many observations in each group. At the preset figures the interval runs from -2.14 to 12.14; raise both groups to 60 and 50 and it nearly excludes zero. The tool uses normal values rather than t, so with small groups the real interval is wider. What kind of comparison are you making?

Popular calculators

All Calculators