Skip to content
MasterMath

T-Test Calculator

The t-test compares two means, or one mean against a reference value, and says whether the difference is bigger than chance would explain. It uses Welch's correction, which does not assume equal variances.

t statistic

—

t statistic—
p-value (two-tailed)—
Degrees of freedom—
Critical value at 95 %—
Conclusion—
p-value (one-tailed)—

How this was worked out

    The formula

    t = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂)

    What it means

    The t statistic is the difference between the means divided by the error of that difference: it measures how many standard errors separate the two groups. A large t means the difference is hard to put down to sampling chance. The p-value puts a number on that difficulty: it is the probability of seeing a difference at least this large if the two groups were really the same.

    How to work it out by hand

    1. Note the mean, the deviation and the size of each group
    2. Work out the error of the difference: the root of the sum of each variance over its size
    3. Divide the difference of means by that error: that is the t statistic
    4. Look up the p-value with the matching degrees of freedom

    What is worth knowing

    A p-value below 0.05 does not mean the difference is important, only that it is hard to attribute to chance; with huge samples, irrelevant differences come out significant. And the other way round: a high p does not prove the groups are equal, only that there is not enough evidence. Welch's correction, applied here by default, avoids assuming the two variances are equal, and that assumption when false gives optimistic p-values.

    Frequently asked questions

    What is a p-value?

    The probability of observing a difference at least as large as yours if the two groups were really identical.

    Two-tailed or one-tailed?

    Two, unless you had a specific direction in mind before seeing the data. Choosing it afterwards invalidates the test.

    What is Welch's correction?

    An adjustment to the degrees of freedom that avoids assuming both groups have the same variance. It is the safe option.

    Does p below 0.05 mean it matters?

    No. It means it is hard to explain by chance. With large samples, tiny differences come out significant.

    Do the data need to be normal?

    The test assumes so, but it copes well with departures at samples of thirty or more. With few values and heavy skew, it does not.