T-Test Calculator
Whether the difference between two sets of numbers is bigger than chance would produce, with the p value and the size of the difference.
Results
What this tool does
Two groups will always differ a little, because any two samples do. The t-test asks whether they differ by more than that — by comparing the gap between their averages against how much the numbers bounce around inside each group. Paste the two groups, choose whether they are separate people or the same people twice, and the answer comes back with the p value, the size of the effect, and a plain sentence saying what it means. Because a p value on its own has misled more research than almost anything else, the effect size is shown next to it: a difference can be real and still be too small to matter.
Formula
t = difference of the means ÷ standard error of that difference · for two groups it uses Welch, which does not assume equal variances
Variables
| Symbol | Meaning | Unit |
|---|---|---|
mode | Which comparison | — |
group_a | First group | — |
group_b | Second group | — |
mu | Compare against this number | — |
alpha | Significance level | % |
OUT | The test | — |
PV | p value (two-tailed) | — |
VD | What that means | — |
TV | t | — |
DF | Degrees of freedom | — |
CR | The value it had to beat | — |
P1 | p value (one-tailed) | — |
MA | Mean of the first | — |
MB | Mean of the second | — |
GP | Gap between them | — |
CD | Size of the difference (Cohen's d) | — |
EF | And that counts as | — |
Worked example
- Which comparisontwo
- First group12, 15, 11, 19, 22, 14, 17, 13, 25, 16
- Second group18, 21, 17, 24, 29, 20, 23, 19, 31, 22
- Compare against this number15
- Significance level5 %
- The testt(18) = -2.9640
- p value (two-tailed)0.008314
- What that meansThe difference is bigger than chance would give
- t-2.9640
- Degrees of freedom17.992
- The value it had to beat2.1010
- p value (one-tailed)0.004157
- Mean of the first16.4000
- Mean of the second22.4000
- Gap between them-6.0000
- Size of the difference (Cohen's d)-1.3255
- And that counts asLarge
Limitations
- The calculation runs entirely in your browser. The values you type are never sent to a server.
- For work that must comply with a standard or be signed off, check the result against the applicable code and have it reviewed by a qualified engineer.
Frequently asked questions
What does the p value actually say?
It is the probability of seeing a difference this large, or larger, if the two groups really came from the same population. That is all. It is not the probability that the groups are the same, nor the probability that you are wrong, and a p of 0.04 is not twice as convincing as one of 0.08. The 0.05 line is a convention borrowed from Fisher in the 1920s, not a law of nature, and a result just on either side of it should be described as what it is: borderline.
Why Welch's version and not the classic one?
Because the classic two-sample test assumes both groups have the same spread, and real groups usually do not. Welch's version drops that assumption, which is why the degrees of freedom here come out as a fraction rather than a whole number. When the spreads really are equal the two versions agree almost exactly, so there is nothing to lose; when they are not, the classic version quietly overstates the significance. Modern statistics texts recommend Welch as the default, and that is what this page does.
What does it assume about my data?
That the observations are independent of each other, and that the values are roughly bell-shaped within each group — or that you have enough of them for the averages to be, which from about thirty per group is usually true whatever the shape. This page checks neither, because it cannot: it sees numbers, not how they were collected. If the same person appears twice in one group, or the data are strongly skewed and the groups are small, the p value below is not measuring what you think.