The t-test is the most commonly used statistical test in science, medicine, social research, and business. It tests whether means are significantly different. This guide covers all three types clearly, with worked examples and decision rules.

When to Use a T-Test

Type 1: One-Sample T-Test

Question: Is the sample mean significantly different from a hypothesised population mean μ₀?

t = (x̄ − μ₀) / (s/√n), df = n−1

Example: A food company claims a snack bar contains 250 calories. You measure 20 bars: x̄ = 262, s = 18. Test if mean differs from 250 at α = 0.05.

t = (262 − 250) / (18/√20) = 12/4.025 = 2.98, df = 19, p = 0.008 → reject H₀. The bars contain significantly more than 250 calories.

Use our One-Sample T-Test Calculator.

Type 2: Two-Sample T-Test (Independent)

Question: Do two independent groups have different means?

Welch's t-test (preferred — does not assume equal variances):

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

Degrees of freedom use the Welch-Satterthwaite approximation (complex formula — our calculator handles this automatically).

Example: Does a new teaching method improve test scores? Control group (n=25): x̄=68, s=10. Treatment group (n=25): x̄=74, s=12. t = 6/√(100/25 + 144/25) = 6/√9.76 = 1.92, p = 0.061 → fail to reject H₀ at α = 0.05 (borderline).

Use our Two-Sample T-Test Calculator.

Type 3: Paired T-Test

Question: Is the mean difference between paired measurements significantly different from zero?

t = d̄ / (s_d/√n), df = n−1

Where d̄ = mean difference between pairs, s_d = SD of differences, n = number of pairs.

Example: Blood pressure measured before and after a drug for n=15 patients. Mean difference d̄ = −12 mmHg, s_d = 8. t = −12/(8/√15) = −12/2.066 = −5.81, df = 14, p < 0.001 → highly significant reduction.

Use our Paired T-Test Calculator.

Choosing Between the Three Types

SituationTest to Use
One group vs hypothesised valueOne-sample t-test
Two unrelated groupsTwo-sample t-test (Welch's)
Same subjects measured twice (before/after)Paired t-test
More than 2 groupsOne-way ANOVA

T-Test vs Z-Test

Use a z-test when σ is known. Use a t-test when σ is unknown (virtually always). At n ≥ 30, the t-distribution approximates the normal, so the distinction matters less. For proportions, use the z-test for proportions.

Effect Size for T-Tests

Always report Cohen's d alongside the t-test result: d = (x̄₁ − x̄₂) / s_pooled. Small: 0.2, Medium: 0.5, Large: 0.8. Tells readers how meaningful the difference is, not just whether it is significant.