TL;DR: A t-test compares averages. It asks whether the difference you see between two means — or between one mean and a known value — is big enough to take seriously, or small enough that it could easily be chance. It turns that difference into a t-statistic: roughly, the size of the difference divided by how much sample means normally wobble. A large t-value (roughly beyond ±2) with enough data usually means the difference is statistically significant. Try it with our free T-Test Calculator.
Suppose a class averages 78 marks after a new teaching method, while last year’s class averaged 72. Is the new method really better, or did this year’s class just happen to contain stronger students? Suppose a machine is supposed to fill bottles with 500 ml, but a sample of 20 bottles averages 496 ml. Is the machine under-filling, or is that just the normal variation between bottles? These are the questions a t-test is built to answer.
Everyday decisions like these come down to one problem: sample averages jump around. Even if nothing has changed, one sample will average a little higher and the next a little lower, purely by chance. A t-test measures your observed difference against that normal wobble, and tells you whether the difference is bigger than chance alone would usually produce. This guide explains the idea in plain English, with no heavy maths — just what the test does, what its numbers mean, and when to use it.
What is a t-test?
A t-test is a statistical test for comparing means (averages). It starts with a null hypothesis — the cautious assumption that there is no real difference — and then checks whether the data are far enough away from that assumption to reject it. If the sample average is close to the value you would expect under the null hypothesis, the test says the difference could easily be chance. If it is far away, the test says the difference is unlikely to be chance, and something real is probably going on.
The name comes from the t-distribution, the bell-shaped curve the test uses to judge how surprising a result is. It was developed in 1908 by William Sealy Gosset, who published under the pen name “Student” — which is why it is also called Student’s t-test. Gosset worked for a brewery and needed a method that worked with small samples, where the older methods broke down.
In practice, a t-test is used in three common situations: testing one sample’s mean against a known value (a one-sample t-test), comparing the means of two separate groups (an independent t-test), and comparing two measurements taken on the same people or items (a paired t-test). The details differ, but the core idea is identical in all three: divide the difference you observed by the amount of random wobble you would expect, and see how large the result is.
What question does a t-test actually answer?
A t-test answers a narrower question than people often think. It does not tell you whether a difference is large, important, or worth acting on. It tells you only whether the difference is unlikely to have arisen by chance from sampling variation alone. A tiny difference can be statistically significant if the sample is huge, and a large difference can be non-significant if the sample is small and noisy. Significance and importance are two different things, and a good report keeps them separate.
Here are the kinds of questions a t-test handles well:
| Situation | Question a t-test answers |
|---|---|
| One group vs a known value | Is this sample’s average really different from 500 ml, 100 points, or some other target? |
| Two separate groups | Is the average of group A really different from the average of group B? |
| Same people, before and after | Did the average really change after the treatment, course, or training? |
The t-statistic, in plain words
The heart of every t-test is the t-statistic, usually written as t. It is a single number that summarises how far your result is from the null hypothesis, measured in units of expected wobble. In words, it is:
t = (observed difference) / (standard error)
The top of the fraction is the difference you actually saw — for example, the sample mean minus the value you are testing against, or the difference between two group means. The bottom, the standard error, measures how much sample means typically bounce around from one sample to the next. It depends on how spread out the data are (the standard deviation) and how many observations you have: more spread means more wobble, and a bigger sample means less.
Degrees of freedom, in plain words
Alongside the t-value, every t-test reports degrees of freedom, usually shortened to df. The phrase sounds technical, but the idea is simple: it is the amount of independent information left in your data after you have used some of it to calculate the average. When you calculate a sample mean, the last value is no longer free to vary — once you know the mean and all the other values, the final one is fixed. So one degree of freedom is “used up” by the mean.
For a one-sample t-test, the degrees of freedom are n − 1, where n is the sample size: 20 bottles give 19 degrees of freedom. For an independent t-test comparing two groups, they are roughly n₁ + n₂ − 2 (one degree of freedom used up by each group’s mean). For a paired t-test, they are the number of pairs minus one. You rarely need to calculate degrees of freedom by hand — the calculator reports them — but you do need to know what they do.
When should you use a t-test?
A t-test is the right choice when you are comparing means, your data are measurements (not categories), and a few conditions are roughly met. The observations should be independent — one person’s score should not influence another’s. The sample should be random, or at least not obviously biased. And the data should be roughly bell-shaped, at least when the sample is small. With large samples (usually 30 or more), the test is forgiving about shape, because averages of large samples tend towards a bell shape whatever the raw data look like.
Do not use a t-test when the outcome is a category or a yes/no count, when the same observations appear in both groups (use a paired test instead), when the data are heavily skewed and the sample is tiny, or when there are extreme outliers that drag the mean around. In those cases the mean is not a good summary of the data, and a test built on means will mislead you. A quick look at the data — a dot plot or a simple summary — before running any test is time well spent.
The three types of t-test at a glance
| Type | Use it when… | Example |
|---|---|---|
| One-sample | You compare one group’s mean with a known value | Is the average bottle fill different from 500 ml? |
| Independent | You compare the means of two separate groups | Do students taught with method A score higher than those taught with method B? |
| Paired | You compare two measurements on the same people or items | Did the same students improve after the revision course? |
How to read a t-test result
A t-test result usually comes as three numbers: the t-value, the degrees of freedom, and the p-value. Read them in order. The t-value tells you how many standard errors your result sits from the null hypothesis — bigger means more surprising. The degrees of freedom tell you how much data backed that up. The p-value turns both into a probability: the chance of seeing a result at least this extreme if the null hypothesis were true. A p-value below 0.05 is the usual cut-off for calling a result statistically significant, though that cut-off is a convention, not a law of nature.
When you report a result, give all three numbers, not just the p-value — for example, “t(19) = 2.40, p = 0.027”. That tells a reader how big the effect was in standard-error units, how much data supported it, and how surprising it was. Also report the actual averages and the size of the difference in real units (marks, millilitres, minutes), because a p-value alone says nothing about whether the difference matters. If you are planning a study, work out your sample size first with our Slovin’s Formula Calculator — a test on too small a sample rarely gives a clear answer.
Frequently Asked Questions
What is a t-test in simple terms?
A t-test is a statistical test that compares averages. It asks whether the difference between two averages — or between one average and a known value — is big enough to be real, or small enough that it could easily have happened by chance in the sample.
What is the difference between a t-test and a z-test?
A t-test is used when the sample is small or the population standard deviation is unknown, which is the usual case in practice. A z-test is used when the sample is large and the population standard deviation is known. With large samples the two tests give almost the same answer.
What is a good t-value?
There is no single good t-value, because what counts as large depends on the degrees of freedom. As a rough guide, with a two-tailed test at the 5% level, a t-value beyond about 2 is usually significant when the sample is not tiny — but always check it against the critical value or the p-value for your degrees of freedom.
What are degrees of freedom in a t-test?
Degrees of freedom are the number of independent pieces of information left in your data after the average has been calculated. For a one-sample t-test they equal the sample size minus one (n - 1). Larger degrees of freedom mean a more precise estimate and a smaller critical t-value.
When should I not use a t-test?
Do not use a t-test when you are comparing categories or proportions rather than averages, when the data are badly skewed with a small sample, or when the observations are not independent. A t-test also cannot prove that a difference is important in practice — it only tests whether it is unlikely to be chance.