t test calculator (Welch, Student, paired, Mann–Whitney)
Paste the values of two groups and the P value and a results sentence appear instantly. The calculations use the same code as the BenchFig app and match SciPy (Python’s statistics library).
Your numbers are processed only in this browser. Nothing is sent to a server (it is gone when you close the page).
Copy a column in Excel and paste it (one value per line). Paste two columns at once and they are split into A and B. A text first line becomes the group name. Blanks, N/A and #DIV/0! are treated as missing; decimal commas such as 12,5 are understood.
How to use it
- Copy the column for group A in Excel and paste it into the left box; paste group B into the right box (or copy both columns at once and paste them into the left box — they are split automatically).
- Choose the test. Use “Unpaired” for independent subjects and “Paired” for before/after measurements on the same subjects. If unsure, keep Welch’s t test.
- Copy the results sentence into your manuscript. “Make the graph in BenchFig” opens the graph screen with the same values.
For paired tests, values on the same row form a pair. Rows with only one value cannot be paired and are dropped (the number dropped is shown).
Which test should I use?
| Your data | Test | Excel T.TEST |
|---|---|---|
| Two independent groups (the usual case) | Welch’s t test: valid even when the SDs differ | =T.TEST(A, B, 2, 3) |
| Two independent groups with equal SDs | Student’s t test (equal variances) | =T.TEST(A, B, 2, 2) |
| Outliers, strongly skewed data, or ranks | Mann–Whitney U test (nonparametric) | — (not in Excel) |
| Same subjects before/after, or matched runs | Paired t test | =T.TEST(A, B, 2, 1) |
| Paired, with strongly skewed differences | Wilcoxon signed-rank test | — |
Welch is recommended because it gives almost the same answer as Student’s test when the SDs are equal, while Student’s test has the wrong error rate when they are not (Delacre et al. 2017). Choosing between them with a preliminary F test is not recommended. See how to do a t test (Student, Welch, paired) and choosing a statistical test.
How to read the results
- P value: the probability of a difference at least this large by chance if there were no real difference. P < 0.05 is usually called significant
- 95% CI of the difference: the range of plausible sizes of the difference. If it excludes 0, P < 0.05. Wider = less certain
- Effect size d: the difference in SD units, independent of n. Rough guide: 0.2 small, 0.5 medium, 0.8 large (Cohen 1988; varies by field)
- Not significant ≠ no difference: with small n even large differences can miss significance. Report the CI as well
The number in brackets after t is the degrees of freedom: nA + nB − 2 for Student’s test, and a non-integer value for Welch’s test (e.g. t(7.10)). See how to report statistics and what the asterisks mean.
What is calculated, and how it was checked
Means, SDs (n − 1), t, degrees of freedom, two-tailed P, the 95% CI of the difference, Cohen’s d (pooled SD) and Hedges’ g; the Mann–Whitney U and P (exact distribution when either group has ≤ 8 values and there are no ties, otherwise the normal approximation with tie and continuity corrections); and the Wilcoxon W and P. All match SciPy 1.18 (ttest_ind, ttest_rel, mannwhitneyu, wilcoxon) in our tests, including n = 2, tied values, tables with missing cells and decimal commas. There are guides to the Mann–Whitney U test and the Wilcoxon signed-rank test too.
FAQ
Is my data sent anywhere?
No. Everything is calculated inside this page in your browser; the numbers are never sent to a server and disappear when you close the page. “Make the graph in BenchFig” also hands the numbers to the graph screen within your browser.
Does it match Excel’s T.TEST?
Yes. Welch equals =T.TEST(A, B, 2, 3), Student equals =T.TEST(A, B, 2, 2) and paired equals =T.TEST(A, B, 2, 1) (the first 2 means two-tailed). The matching formula is shown with your result.
Can I use it with n = 2 or 3?
Yes, as long as each group has at least two values. But power is low with so few values and normality cannot be checked. Show the individual points and report the confidence interval.
Can I run a one-tailed test?
This calculator is two-tailed only. One-tailed tests are only justified when the direction was fixed before collecting data, and most journals expect two-tailed tests.
What about three or more groups?
Repeating t tests inflates false positives. Use one-way ANOVA with multiple comparisons (Tukey, Dunnett): paste three or more columns into the BenchFig graph screen.
Other calculators
Related guides
Product names are trademarks or registered trademarks of their respective owners.