explainer
The t-Test Explained: One-Sample, Two-Sample and Paired
By the LazyTools team · Published 2026-07-12 · Updated 2026-07-12 · 4 min read
A t-test answers one deceptively simple question: is this difference in averages real, or could it just be chance? Two groups almost never have identical means even when nothing is going on, so the t-test measures whether the gap you see is bigger than random noise would plausibly produce. Here’s how to run the right one and read it correctly.
The core idea
The t statistic is a signal-to-noise ratio:
t = (difference in means) / (standard error of that difference)
The numerator is the effect you’re interested in; the denominator is how much the means would wobble from sampling alone. A big t means the difference is large relative to the noise. You then convert t (with its degrees of freedom) into a p-value using the t-distribution — the probability of a t this extreme if there were no real difference.
Which t-test? Match it to your design
- One-sample — you have one group and a fixed reference value. “Is the mean fill weight really 500 g?” You test the sample mean against 500.
- Two-sample (independent) — two separate groups. “Do method A and method B differ?” You compare the two group means. This is the most common case.
- Paired — two measurements on the same subjects. “Did blood pressure change after the drug?” You don’t compare group averages; you compute each person’s difference and test whether those differences average to zero. Pairing removes person-to-person variation, making it far more powerful than treating before and after as independent groups.
Getting this choice right matters more than any other decision — a paired design analysed as two independent samples throws away its biggest advantage.
Welch or pooled?
For the two-sample test there are two flavours:
- Pooled (Student’s) assumes both groups have the same variance.
- Welch’s does not — it allows unequal variances and adjusts the degrees of freedom.
Default to Welch’s. It’s more reliable when the groups have different sizes or spreads, and it costs almost nothing when they’re similar. The old habit of running an equal-variance test is rarely worth it; reach for pooled only when equal variances are genuinely justified.
Reading the result — and the big trap
Compare the p-value to your significance level α (conventionally 0.05):
- p < α → reject the null hypothesis. The difference is “statistically significant” — unlikely to be chance.
- p ≥ α → fail to reject the null.
Here’s the mistake nearly everyone makes: failing to reject is not proof there’s no difference. It means you didn’t find enough evidence — which can happen simply because the sample was too small to detect a real effect (low statistical power). “Not significant” and “no effect” are different claims. And significance isn’t importance: with a huge sample, a trivially small difference can be statistically significant yet practically meaningless, so always look at the size of the difference too.
Run it
The t-test calculator does all three types from summary statistics (means, standard deviations and sample sizes), defaults to Welch’s for two samples, handles one- or two-tailed hypotheses, and gives the exact t, degrees of freedom, p-value and a plain-English significance verdict. For categorical counts instead of means, use the chi-square test; to turn a test statistic you already have into a p-value, use the p-value calculator. Everything runs in your browser — your data is never uploaded.
The t-test assumes roughly normal data (or a large enough sample for the central limit theorem to apply) and, for the pooled version, equal variances. p-values come from the exact Student t-distribution. This is educational content; for high-stakes analysis, check the assumptions and consider effect size and power. Source: standard mathematical-statistics treatment of the t-test (e.g. Student 1908; Welch 1947).
Frequently asked questions
What does a t-test tell you?
Whether a difference in means is likely real or could plausibly be chance. It produces a t statistic (the difference in means divided by its standard error) and a p-value; a small p-value means the difference is unlikely under the null hypothesis of no real difference.
What is the difference between one-sample, two-sample and paired t-tests?
One-sample compares a single group's mean to a fixed value. Two-sample compares the means of two independent groups. Paired compares two measurements on the same subjects (before/after) by testing whether their differences average to zero.
Should I use Welch's or the pooled t-test?
Use Welch's (unequal-variance) test by default — it's more reliable when the two groups have different sizes or spreads, and barely loses anything when they don't. Use the pooled (equal-variance) test only when equal variances are genuinely justified.
What does the p-value mean in a t-test?
The probability of seeing a difference at least this large if there were truly no difference (the null hypothesis). If it's below your significance level α (usually 0.05), you reject the null and call the result statistically significant.
Does a non-significant t-test prove there's no difference?
No — this is the most common mistake. 'Fail to reject the null' means there wasn't enough evidence of a difference, not that the difference is zero. A small sample can miss a real effect (low power).
When should I use one-tailed vs two-tailed?
Two-tailed (the default) tests for a difference in either direction. Use one-tailed only when you have a specific directional hypothesis set in advance; it's more powerful in that direction but can't detect an effect the other way.