The t-test explained: when and how to use it

By Dr. Rafiq Muhammad, MD, PhD · Updated June 2026

A t-test answers one question: is the difference between these means bigger than chance would produce? It works on a continuous outcome (test scores, blood pressure, reaction time) and returns a t-statistic and a p-value. The only real decision is which of the three t-tests matches how your data are structured.

The three types — pick by your design

TypeComparesExample
One-sampleOne group’s mean vs a known valueIs our class’s mean score different from the national 70?
Independent samplesMeans of two separate groupsDo treatment vs control groups differ?
PairedTwo measures on the same subjectsBefore vs after, same people

The paired test is the one people miss: if the same subjects are measured twice, a paired t-test is more powerful than treating the measurements as independent.

What the result tells you

The p-value says how surprising your difference would be if the true means were equal. But significance isn’t the whole story — always report the difference in means and a confidence interval, plus an effect size (Cohen’s d), so a reader sees how big the difference is, not just that it cleared p < 0.05.

Assumptions (and when to switch tests)

If normality is badly broken, switch to a non-parametric test (Mann–Whitney U for independent, Wilcoxon for paired).

t-test vs ANOVA

A t-test compares two means. With three or more groups, don’t run a pile of t-tests — that inflates your false-positive rate. Use ANOVA instead, which is the multi-group generalisation of the t-test.

Not sure the t-test is even the right choice? The free Statistical Test Selector takes you from your data type, number of groups, and design to the correct test in four questions.

Get the free Statistics toolkit

A reporting checklist, worked examples, and test-selection flowcharts from the Statistical Test Selection Workbook. We’ll email you the download link.

One email with your download, then occasional research tips. One-click unsubscribe, anytime. We never sell your data.

Get the Statistical Test Selection Workbook

Frequently asked questions

What does a t-test do?

Compares means to ask whether a difference is bigger than sampling noise — on a continuous outcome, returning a t-statistic and p-value.

What are the three types?

One-sample (vs a fixed value), independent (two groups), and paired (same subjects measured twice).

t-test or ANOVA?

t-test for two means; ANOVA for three or more groups — running many t-tests inflates false positives.

What are the assumptions?

Approximate normality, independence, and (for the independent test) equal variances or Welch’s correction.

ANOVA explained → Open the Test Selector →