Decision guide

Which t-test should I use?

Three questions settle it: how many groups, whether the values are linked, and what you are comparing against. Work through them in order.

Sources checked on November 21, 2026. Results computed by the site's engine and tested against R and SciPy.

Question 1: what are you comparing?

  • One sample against a fixed number (a target, a specification, a published value): the one-sample t-test.
  • Two sets of numbers: go to question 2.
  • Three or more groups: a t-test is the wrong tool. Repeated t-tests inflate the chance of a false positive; use analysis of variance instead.

Question 2: are the two sets linked?

Values are linked if each one in the first set has a natural partner in the second: the same person measured twice, matched pairs, twins, left and right eyes, two lab methods on the same sample. Linked values need the paired t-test. If the two sets come from different, unrelated units, use the independent samples test.

The data layout can mislead. Two columns of equal length are not necessarily paired; ask whether row three of one column belongs with row three of the other.

Question 3: Welch or Student?

For independent groups, use Welch's test unless you have a strong reason to assume equal variances. It is R's default and the recommendation of Delacre, Lakens and Leys (2017). Do not choose by running a variance test first. Our calculators show Student's result beside Welch's, so you can report it if your course or journal requires it. The Welch vs Student guide has the detail.

Case 1: a new teaching method

One class of 28 learns with a new method and another class of 31 with the usual one. Each student is in one class only, so the groups are independent: use Welch's independent samples test. Students within a class share a teacher and a room, so they are not fully independent of each other. With only two classes, any difference between the teachers is mixed up with the method, so read the result with care.

Case 2: blood pressure before and after

Twenty patients have their blood pressure measured, take a drug for a month, and are measured again. Each patient gives two linked numbers: use the paired test. Analyzing them as independent groups wastes the pairing. In Student's sleep data, the paired test gives p = 0.0028, while an independent test on the same numbers gives 0.0794.

Case 3: does a filling machine hit 500 ml?

You weigh 40 bottles from one machine and want to know whether the mean differs from the 500 ml on the label. One sample, one fixed value: the one-sample test. If the label promises at least 500 ml and you only care about underfilling, a one-sided test fits, but decide that before you weigh anything (one-tailed vs two-tailed).

When a t-test is not the right choice

  • Very skewed data or strong outliers with small samples: the Mann-Whitney U test for independent groups or the Wilcoxon signed rank test for paired data.
  • Counts in categories (how many said yes or no): a test for proportions or a contingency table test, not a t-test.
  • Many measurements per person over time: a repeated measures or mixed model.
  • A known population SD (rare outside textbooks): a z-test. With a sample SD, use t.

Summary table

Your dataTestCalculator
One sample vs a fixed valueOne-sample t-testOne-sample
Two linked measurementsPaired t-testPaired
Two separate groupsWelch's t-test (Student beside it)Independent
Two separate groups, skewed, smallMann-Whitney UMann-Whitney
Linked pairs, skewed, smallWilcoxon signed rankWilcoxon

Sources