Two-Sample t-Test Calculator (Welch)

Quick answer

This two-sample t-test calculator compares the means of two independent groups with Welch's t-test (or Student's pooled test), from summary statistics or raw data. It gives t, the Welch degrees of freedom, the p-value, critical values, the confidence interval for the difference and Cohen's d.

p-value
0.03
t statistic
2.1618
Degrees of freedom
56.93
Decision
Reject H₀ at α = 0.05 – p = 0.0348 ≤ 0.05 and t = 2.1618 lies in the rejection region.
Critical t
±2.0025
Rejection region
t ≤ −2.0025 or t ≥ 2.0025
Difference in means (x̄₁ − x̄₂)
2.5
Standard error of the difference
1.15643
Confidence interval for μ₁ − μ₂ (two-sided, 1 − α)
95% CI: 0.1842 to 4.8158
Cohen's d (pooled SD)
0.5452
Hedges' g (bias-corrected)
0.5387
Pooled standard deviation
4.5856
Variance ratio s₁² ÷ s₂²
0.7056
Group summary
Group n Mean SD SE of mean ──────────────────────────────────── 1 35 24.1 4.2 0.7099 2 30 21.6 5 0.9129
t distribution with rejection region

Comparing two group averages (treatment and control, two production lines, two teaching methods) is one of the most common tasks in statistics. The two-sample t-test asks whether the observed difference between the sample means is larger than you would expect from random sampling if the population means were equal.

Welch’s version, published by Bernard Welch in 1947, does not assume that the two populations have the same variance. Each group contributes its own variance to the standard error, and the degrees of freedom come from the Welch–Satterthwaite approximation, which is usually a non-integer between the smaller of n₁ − 1 and n₂ − 1 and n₁ + n₂ − 2. Simulation studies show Welch’s test keeps its false-positive rate close to α even when variances and sample sizes differ, whereas the classic pooled test can go badly wrong. That is why R and many textbooks now use it by default.

The calculator still offers the pooled Student test for comparison. Alongside the p-value it reports the confidence interval for the difference in means and Cohen’s d, so you can judge whether a statistically significant difference is also practically important.

How to use the Two-Sample t-Test Calculator

  1. Data entry
  2. Mean of group 1
  3. SD of group 1
  4. Size of group 1
  5. Mean of group 2
  6. SD of group 2
  7. Size of group 2
  8. Group 1 values
  9. Group 2 values
  10. Variances
  11. Hypothesised difference Δ₀ = μ₁ − μ₂
  12. Alternative hypothesis H₁ (μ₁ − μ₂ compared with Δ₀)
  13. Significance level (α)

Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.

How it works

Enter the mean, standard deviation and size of each group, or paste the raw values. The calculator finds the standard error of the difference, the t statistic and the Welch (or pooled) degrees of freedom, and evaluates the t distribution for the p-value, critical value and confidence interval.

Worked example

Group 1: x̄₁ = 24.1, s₁ = 4.2, n₁ = 35. Group 2: x̄₂ = 21.6, s₂ = 5.0, n₂ = 30. s₁²/n₁ = 0.504 and s₂²/n₂ = 0.833, so SE = √1.337 = 1.1564 and t = 2.5 ÷ 1.1564 = 2.162.

df = 1.337² ÷ (0.504²/34 + 0.833²/29) = 56.93. The two-tailed p-value is 0.0348 and the critical t is ±2.0025, so we reject H₀ at α = 0.05. The 95% confidence interval for μ₁ − μ₂ is 0.18 to 4.82, and Cohen’s d = 0.55.

Welch or pooled?

Situation Recommended
Equal n, similar SDs Either, as results are almost identical
Unequal n and unequal SDs Welch’s t-test
Larger SD in the smaller group Welch’s, because the pooled test gives too many false positives
Very skewed data, small n Mann–Whitney U test

Formula

t = (x̄₁ − x̄₂ − Δ₀) ÷ √(s₁²/n₁ + s₂²/n₂) · df = (s₁²/n₁ + s₂²/n₂)² ÷ [(s₁²/n₁)²/(n₁ − 1) + (s₂²/n₂)²/(n₂ − 1)] · CI = (x̄₁ − x̄₂) ± t* × SE · d = (x̄₁ − x̄₂) ÷ s_pooled

Worked example

Inputs: Data entry: Summary statistics; Mean of group 1: 24.1; SD of group 1: 4.2; Size of group 1: 35; Mean of group 2: 21.6; SD of group 2: 5; Size of group 2: 30; Variances: Not assumed equal – Welch's t-test; Hypothesised difference Δ₀ = μ₁ − μ₂: 0; Alternative hypothesis H₁ (μ₁ − μ₂ compared with Δ₀): Two-tailed (H₁: not equal); Significance level (α): 0.05.
Results: p-value = 0.03; t statistic = 2.1618; Degrees of freedom = 56.93; Decision = Reject H₀ at α = 0.05 – p = 0.0348 ≤ 0.05 and t = 2.1618 lies in the rejection region.; Critical t = ±2.0025; Rejection region = t ≤ −2.0025 or t ≥ 2.0025.

Key terms

Welch's t-test
A two-sample t-test that uses separate variances for the two groups.
Welch–Satterthwaite degrees of freedom
The approximate df used by Welch's test.
Standard error of the difference
√(s₁²/n₁ + s₂²/n₂), the uncertainty of x̄₁ − x̄₂.
Hedges' g
Cohen's d multiplied by a small-sample correction factor.

Frequently asked questions

Why use Welch instead of Student's t-test?

Welch's test stays accurate when the group variances differ, especially with unequal sample sizes, and loses very little power when they are equal. Testing for equal variances first is no longer recommended.

Why are the degrees of freedom not a whole number?

They come from the Welch–Satterthwaite approximation. For the default data df = 56.93, slightly fewer than the pooled 63.

What about paired data?

Use a paired t-test (a one-sample test on the differences). The two-sample test assumes the groups are independent.

How big should the samples be?

With roughly normal data, 10–15 per group can work; with skewed data aim for 30 or more per group, or use the Mann–Whitney U test.

What does the confidence interval tell me?

The range of plausible values for the true difference in means. If it excludes Δ₀ (usually 0), the two-tailed test is significant at the same α.

How do I interpret Cohen's d?

Roughly 0.2 small, 0.5 medium and 0.8 large. The default example has d = 0.55, a medium effect.

Can I test for a specific difference, not just zero?

Yes. Set Δ₀, for example to test whether a new process improves the mean by more than 2 units.

Sources

  1. Wikipedia: Welch's t-test
  2. NIST/SEMATECH e-Handbook of Statistical Methods
  3. Penn State STAT 500: Applied Statistics

Cite this calculator

Speedy Calculator. (2026). Two-Sample t-Test Calculator (Welch). Speedy Calculator. https://speedycalculator.com/calculators/statistics/two-sample-t-test/