Statistics & Probability

Welch Two-Sample Mean Test & Confidence Interval Calculator

Compare two independent sample means with unequal-variance standard error, Welch degrees of freedom and a two-sided interval.

How the calculation works

difference = mean_a-mean_b. variance_a = sd_a**2/n_a. variance_b = sd_b**2/n_b. se = sqrt(variance_a+variance_b). df = (variance_a+variance_b)**2/(variance_a**2/(n_a-1)+variance_b**2/(n_b-1)). Observed mean difference A − B = difference . Estimated standard error = se . Welch–Satterthwaite degrees of freedom = df . t statistic for entered null difference = (difference-null_difference)/se . Two-sided p-value = 2*t_cdf(-abs((difference-null_difference)/se),df) . Confidence interval lower endpoint = difference-t_quantile((1+confidence/100)/2,df)*se . Confidence interval upper endpoint = difference+t_quantile((1+confidence/100)/2,df)*se .

Worked example

Example inputs — Sample A mean: 10; Sample A standard deviation: 2; Sample A size: 10; Sample B mean: 10; Sample B standard deviation: 2; Sample B size: 10; Null mean difference A − B: 0; Two-sided confidence level (%): 95. Expected results — Observed mean difference A − B: 0; Estimated standard error: 0.894427191; Welch–Satterthwaite degrees of freedom: 18; t statistic for entered null difference: 0; Two-sided p-value: 1; Confidence interval lower endpoint: -1.879121799; Confidence interval upper endpoint: 1.879121799.

Assumptions and limits

Welch test for independent samples; it does not assume equal population variances. Reported confidence interval is for the actual mean difference, while the t statistic tests the entered null difference. Valid inference depends on sampling design, independence and the distribution or adequate sample sizes; paired observations require a paired analysis. A p-value does not measure effect importance or probability that a hypothesis is true. Zero variance in both samples does not yield a defined test.

Reference and further reading

Read the underlying subject reference. Calculith is an independent implementation; the reference does not endorse or certify this tool.

Related calculators

Browse all 1000 calculators →

Example values are editable. Results are estimates where assumptions apply. Calculations run in your browser. Updated 2026-11-16.