What Is a T-Test and When to Use It? A Plain-Language Guide for Researchers

A t-test is a statistical test that checks whether the average (mean) of one group is meaningfully different from another, or from a known value — and you use it when you're comparing the means of one or two groups of a numeric outcome. If you're staring at two columns of scores wondering "is this difference real or just random noise?", the t-test is almost certainly the tool you need — and it's one of the most common sources of confusion for graduate students running their first analysis.

Key Takeaways

  • A t-test compares means. It tells you whether the difference between two averages is larger than you'd expect from chance alone.
  • There are three types: a one-sample t-test (one group vs a known value), an independent-samples t-test (two separate groups), and a paired-samples t-test (the same people measured twice).
  • Use a t-test when your outcome is continuous (like test scores, reaction times, or blood pressure) and you're comparing no more than two groups — for three or more, use ANOVA instead.
  • A p-value below .05 conventionally means the difference is "statistically significant," but you should always report an effect size (Cohen's d) too.
  • Your data should be roughly normally distributed. If it isn't, the Mann-Whitney U test is the non-parametric alternative.

What does a t-test actually tell you?

A t-test answers one question: is the gap between two means big enough to take seriously, given how much the data naturally varies? Two groups will almost never have identical averages, so the real issue is whether the difference is signal or noise.

The test works by producing a t value — a ratio of the difference between means to the variability within the groups. A bigger difference and tighter, more consistent data push the t value up. The further t is from zero, the stronger the evidence that the groups genuinely differ.

That t value gets converted into a p-value: the probability of seeing a difference this large if there were truly no difference in the population. A small p-value (typically below .05) suggests the difference is unlikely to be a fluke.

What are the three types of t-test?

Choosing the right type is the step most people get wrong. Each one matches a specific research design.

One-sample t-test

Use this when you compare one group's mean against a known or expected value. Example: you want to know whether the average IQ in your sample of 50 gifted students differs from the population average of 100.

Independent-samples t-test

Use this when you compare the means of two separate, unrelated groups. Example: comparing anxiety scores between a treatment group and a control group, where no person appears in both groups.

Paired-samples t-test

Use this when the same participants are measured twice, or when subjects are matched. Example: comparing each patient's blood pressure before and after taking a medication. Because the two measurements come from the same people, they're linked — and the paired test accounts for that.

When should I use a t-test (and when should I not)?

Reach for a t-test when all of these are true:

  • Your outcome variable is continuous (interval or ratio — scores, time, weight, etc.).
  • You're comparing one or two groups only.
  • Your data is approximately normally distributed within each group.
  • For the independent test, the two groups have roughly equal variances (Levene's test checks this — and if it fails, Welch's t-test corrects for it automatically).

Do not use a t-test if:

  • You have three or more groups → use a one-way ANOVA instead.
  • Your outcome is a category or count (e.g. pass/fail) → use a chi-square test.
  • Your data is heavily skewed or ordinal → use the Mann-Whitney U test (for two independent groups) or Wilcoxon signed-rank test (for paired data). If you're torn between these, see our guide on Mann-Whitney vs the t-test.

A worked example with real numbers

Suppose you're testing whether a 6-week mindfulness program reduces stress. You recruit 60 students: 30 complete the program (treatment) and 30 act as a control. Afterward, everyone completes a stress questionnaire (scored 0–50).

  • Treatment group: M = 22.4, SD = 5.1
  • Control group: M = 27.8, SD = 6.0

Because you have two separate groups and a continuous outcome, you run an independent-samples t-test. Here's what the output means:

t(58) = 3.76, p < .001, d = 0.97

  • t(58) — the test statistic, with 58 degrees of freedom (roughly your total sample minus 2).
  • p < .001 — there's less than a 0.1% chance you'd see a gap this large if the program truly did nothing. This is statistically significant.
  • d = 0.97 — Cohen's d, the effect size. By convention, 0.2 is small, 0.5 is medium, and 0.8 is large, so 0.97 is a large effect. The groups differ by nearly one full standard deviation.

The takeaway: the mindfulness group reported substantially lower stress, and the difference is both statistically significant and practically meaningful. Reporting the effect size matters because a tiny, trivial difference can still be "significant" with a large enough sample — the p-value alone never tells the whole story.

T-test vs ANOVA vs Mann-Whitney: which do I need?

Situation Use this test Why
One group vs a known value One-sample t-test Single mean compared to a benchmark
Two separate groups, normal data Independent-samples t-test Compares two unrelated means
Same people measured twice Paired-samples t-test Accounts for within-person correlation
Three or more groups One-way ANOVA T-tests inflate error with 3+ comparisons
Two groups, skewed/ordinal data Mann-Whitney U Non-parametric alternative to the t-test
Paired data, non-normal Wilcoxon signed-rank Non-parametric alternative to the paired t-test

How do I report a t-test in APA 7 format?

APA 7 wants the test statistic, degrees of freedom, p-value, and an effect size, written in a specific style. Using the example above:

An independent-samples t-test showed that the mindfulness group reported significantly lower stress (M = 22.4, SD = 5.1) than the control group (M = 27.8, SD = 6.0), t(58) = 3.76, p < .001, d = 0.97, 95% CI [2.53, 8.27].

Note the APA conventions: t, p, M, SD, and d are italicised; the p-value has no leading zero (.001, not 0.001); and a 95% confidence interval for the mean difference is included. Getting this notation right is exactly the kind of fiddly formatting that costs students marks — and it's where an automated tool earns its keep.

Letting StatRyx pick and run the right test

If you're not a statistician, the hardest part isn't the math — it's knowing which of these tests your data calls for and writing it up correctly. StatRyx is an AI-powered statistical analysis tool that replaces manual SPSS workflows with automated, APA 7-formatted reporting. You upload your data, describe your question in plain English, and StatRyx checks the assumptions (normality, equal variances), chooses between the independent t-test, Welch's correction, or Mann-Whitney automatically, and hands back a finished APA write-up — confidence interval and effect size included.

Unlike SPSS, which can cost roughly $100+ per month on a subscription licence, StatRyx runs free in your browser, so there's nothing to install and no syntax to memorise. For students who just need the right test chosen and the results reported correctly, that's the whole job done.

**Stop calculating this by hand — run it free in St

Stop calculating this by hand. Upload your dataset and StatRyx's AI runs the correct test and returns copy-paste-ready APA 7 output in seconds — no SPSS license, no syntax.

Run your data through StatRyx free →
← All posts