Welch’s test is the recommended default for comparing two group means, such as treatment and control.
How to use the Two-Sample t-Test Calculator
- Mean of group 1
- SD of group 1
- Size of group 1
- Mean of group 2
- SD of group 2
- Size of group 2
Results update as you type, and every field accepts the units shown in its menu.
How it works
The difference in means is divided by the combined standard error; degrees of freedom use the Welch–Satterthwaite formula.
Inputs explained
| Field | What to enter |
|---|---|
| Mean of group 1 | A number |
| SD of group 1 | A number |
| Size of group 1 | A number |
| Mean of group 2 | A number |
| SD of group 2 | A number |
| Size of group 2 | A number |
What each result means
- t statistic = ([Mean of group 1] – [Mean of group 2])÷sqrt([v1] + [v2])
- Degrees of freedom = ([v1] + [v2])^2÷([v1]^2÷([Size of group 1] – 1) + [v2]^2÷([Size of group 2] – 1))
- Two-tailed p-value = 2×(1 – tcdf(abs([t statistic]), [Degrees of freedom]))
Example values
How the main result changes when Mean of group 1 changes and everything else stays at the example values above:
| Mean of group 1 | Two-tailed p-value |
|---|---|
| 12.05 | 2.5888e-11 |
| 18.08 | 0.0035 |
| 24.1 | 0.0348 |
| 30.13 | 7.6908e-10 |
| 36.15 | 0 |
| 48.2 | 0 |
Formula
t = (x̄₁ − x̄₂) ÷ √(s₁²/n₁ + s₂²/n₂)Worked example
Inputs — 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.
Results — t statistic = 2.1618; Degrees of freedom = 56.93; Two-tailed p-value = 0.03485.
Frequently asked questions
Why Welch instead of Student’s t-test?
Welch remains accurate when group variances differ and loses little when they are equal.
What about paired data?
Use a one-sample t-test on the differences.
What formula does the Two-Sample t-Test Calculator use?
t = (x̄₁ − x̄₂) ÷ √(s₁²/n₁ + s₂²/n₂).