T-Test Calculator
Run a t-test on your data: two independent samples (Welch), one sample against a value, or paired samples.
About the T-Test Calculator
A t-test checks whether a difference in means is larger than random variation would explain. Welch's version doesn't assume the two groups have equal variances, which makes it the safer default. Student's pooled version, taught in most textbooks, assumes equal variances and uses the pooled S² with n₁ + n₂ − 2 degrees of freedom.
The F-test checks that assumption: F = s₁²/s₂² (larger variance on top) with (n₁ − 1, n₂ − 1) degrees of freedom. A small p-value means the variances differ, so use Welch's test.
The formula
Welch: t = (x̄₁ − x̄₂) ÷ √(s₁²/n₁ + s₂²/n₂); F = s₁²/s₂²
- df (Welch)
- (s₁²/n₁ + s₂²/n₂)² ÷ [ (s₁²/n₁)²/(n₁−1) + (s₂²/n₂)²/(n₂−1) ]
- Pooled (Student)
- t = (x̄₁ − x̄₂) ÷ (S√(1/n₁ + 1/n₂)), S² = ((n₁−1)s₁² + (n₂−1)s₂²)/(n₁ + n₂ − 2)
- Paired
- one-sample t-test on the differences
Worked example
Example: p-value = 0.015355
- Inputs: Test: Two independent samples (Welch); Sample A (or differences / single sample): 5.1, 4.9, 5.6, 5.8, 6.0, 5.4; Sample B: 4.6, 4.8, 5.0, 4.7, 5.2, 4.9; Test: Two-tailed.
- Formula: Welch: t = (x̄₁ − x̄₂) ÷ √(s₁²/n₁ + s₂²/n₂); F = s₁²/s₂²
- Result: p-value = 0.015355
- t statistic: 3.123946
- Degrees of freedom: 7.4937
Questions people ask
When should I use a paired test?
When each value in A is matched with one in B, such as before and after measurements on the same people.
Do the data need to be normal?
Roughly, for small samples. With 30+ values per group the test is robust.