Compare two means with Welch's, Student's or the paired t-test. Every result shows the test you did not pick next to yours, plus the interval, Cohen's d, Hedges' g and the group size for 80% power.
Two-Sample T-Test Calculator - Welch, Student and Paired
Compare two means with Welch's, Student's or the paired t-test. Every result shows the test you did not pick next to yours, plus the interval, Cohen's d, Hedges' g and the group size for 80% power.
Parameters
Enter data for calculations
💡 Fill in all required fields to unlock the calculate button
Two-sample t-test: Welch, Student or paired, with the other two shown alongside
The same twenty numbers can give p = 0.0794 or p = 0.0028. The difference is not in the data but in the design: two unrelated groups, or the same ten people measured twice. This calculator runs Welch's test, Student's pooled test or the paired test, prints the result of the test you did not choose next to it, and adds the confidence interval for the difference, Cohen's d, Hedges' g and the group size needed for 80% power.
One classic data set, three verdicts
Student's own sleep data: extra hours of sleep for ten patients on two drugs. Group A: 0.7 -1.6 -0.2 -1.2 -0.1 3.4 3.7 0.8 0.0 2.0. Group B: 1.9 0.8 1.1 0.1 -0.1 4.4 5.5 1.6 4.6 3.4. The values match R's t.test to four decimals.
The patients who slept longer on one drug slept longer on the other. Pairing removes that person-to-person spread: the standard error drops from 0.8491 to 0.389, and the 95% interval for the difference narrows from -3.3655 to 0.2055 into -2.4599 to -0.7001. The data were paired, so the paired verdict is the right one.
From design to verdict in five choices
- Design - two independent groups of raw values, paired measurements (the same people or objects in both lists, in the same order), or the mean, SD and n of each group from a report.
- The values - separated by spaces, commas or new lines, a dot for decimals, no thousands separators. For paired data both lists must have the same length.
- Version of the test - Welch or Student, for independent groups only. Welch is the safer default; the result prints both anyway.
- Alternative hypothesis - two-sided, or one-sided with A greater or A less than B, decided before looking at the data.
- Significance level - 0.05, 0.01 or 0.10. Then read t, p, the interval, the effect sizes and the comparison row.
Welch against Student, side by side
| Welch | Student (pooled) | |
|---|---|---|
| Assumes equal variances | No | Yes |
| Standard error | √(sA²/nA + sB²/nB) | sp √(1/nA + 1/nB) |
| Degrees of freedom | Welch-Satterthwaite, often a fraction | nA + nB - 2 |
| Equal groups, equal spread | Practically the same answer | Practically the same answer |
| Small group with the larger spread | Keeps the false-alarm rate near alpha | Too many false alarms |
| Where you meet it | R t.test default, Excel T.TEST type 3 | Excel T.TEST type 2, many textbooks |
When the two disagree, the equal-variance assumption decides the verdict. Take 40 values with SD 1 against 8 values with SD 4 and means 10 and 11.6. Student says p = 0.0273, significant; Welch says p = 0.2971 on 7.18 degrees of freedom. The variances differ 16-fold, and the pooled SD is dominated by the large, quiet group, so Student understates the uncertainty of the small, noisy one. The calculator flags both the ratio and the split decision.
A report with only means and SDs
Two teaching methods: 32 students average 78.4 (SD 9.2), 29 average 72.9 (SD 11.8). Welch gives t = 2.016, p = 0.0489, 95% interval 0.0264 to 10.9736 points, d = 0.52. Significant, but only just: the interval nearly touches zero, and a replication with the same effect would need about 59 students per group for an 80% chance of significance.
Group sizes for 80% power
Independent groups need far more observations than pairs for the same d, because pairing cancels the spread between subjects. Per group, alpha 0.05, from the noncentral t distribution:
| Effect size d | Two groups, two-sided | Two groups, one-sided | Pairs, two-sided |
|---|---|---|---|
| 0.2 | 394 | 310 | 199 |
| 0.5 | 64 | 51 | 34 |
| 0.8 | 26 | 21 | 15 |
| 1.0 | 17 | 14 | 10 |
For pairs, d means dz: the mean difference divided by the SD of the differences. It is not the same number as d between groups, so compare the columns only through the design, not through the label.
Two-sample t-test questions
Related tools
P-Value Calculator
The exact p for a t with fractional Welch degrees of freedom, and critical values for z, t, chi-square and F - See calculator
One-Sample T-Test Calculator
One sample against a fixed number: a label, a target or a norm - See calculator
Wilcoxon Test Calculator
Rank-sum and signed-rank tests when the data are skewed or small - See calculator
Fisher Exact Test Calculator
Two groups compared on a yes-or-no outcome instead of a measurement - See calculator
Z-Score Calculator
Screen each group for outliers before comparing the means - See calculator
Standard Deviation Calculator
The SD of each group, for the summary mode - See calculator
Coefficient of Variation Calculator
Compare the relative spread of the two groups - See calculator