How this calculator works
- Step 1Differencex̄₁ − x̄₂How far apart the means are.
- Step 2Standard error√(s₁²/n₁ + s₂²/n₂)How much that difference wobbles.
- Step 3p-valuet with Welch dfHow surprising the difference is.
The t statistic is the difference between the sample means divided by its standard error. A large t, in either direction, is evidence that the population means differ.
Welch’s version does not assume equal variances, and works out the degrees of freedom from both samples.
Worked example: OpenStax Example 10.1
- t
(2 − 3.2) ÷ √(0.866²/9 + 1²/16)
- Difference−1.2
- Standard error0.3819
- t-3.14
- Degrees of freedom18.85
- Two-tailed p0.0054
OpenStax gives t = −3.14, df ≈ 18.8462 and p = 0.0054.
Read the result
- Example 10.1p = 0.0054Below 5%: the means differ.
- Example 10.2p = 0.1928Right-tailed; not enough evidence at 5%.
Identical sample means give t = 0 and p = 1.0000: no evidence of a difference.
Assumptions and limits
- Independent groupsNot paired or repeated measures.
- Roughly normalOr reasonably large samples.
- Sample SDsUse n − 1 standard deviations.
- Not pairedPaired data needs a one-sample t-test on differences.
Related statistics tools
A t-test compares two means. Spread, intervals and other tests sit around it.
To turn any test statistic into a p-value, use the p-value calculator. The confidence interval calculator gives a margin of error, and the chi-square calculator tests counts in categories.
Common mistakes
Mistake: Using population SDs as sample SDs.
Instead: Use the sample standard deviations.
Mistake: Running a two-sample test on paired data.
Instead: Test the differences instead.
Checking the method
A separate script integrates the t curve numerically and reproduces OpenStax Examples 10.1 and 10.2.
Read how we test our calculators, or browse more maths calculators.