Statistics & graphs · SL/HL
Two-sample t-test
Compare independent or paired samples with a t-test.
Your values
Number formats & units
Use decimal dots in datasets. Single values also accept decimal commas and scientific notation such as 1.2e-3 or 1.2 × 10⁻³.
Calculated locally. No account or input upload.
Result & working
ExampleThe calculator is loading. The worked example is also shown below.
Download results
Excel and CSV files can be imported into Google Sheets.
More results
Show calculation steps
Interpretation & assumptions
Copy & export
Formula & example
The relationship
What the variables mean
| Symbol | Meaning |
|---|---|
| Two-tailed probability under the null model. | |
| Degrees of freedom. |
Worked example
- Test type
- Independent samples (Welch)
- Sample A
- 12.1 11.8 12.4 12.0 11.9
- Sample B
- 13.0 12.8 13.4 12.9 13.2
t = -6.845792, p = 0.0001328
Follow the example steps
- x̄₁ = 12.04, s₁ = 0.2302173, n₁ = 5
- x̄₂ = 13.06, s₂ = 0.2408319, n₂ = 5
- t = (x̄₁−x̄₂)/√(s₁²/n₁+s₂²/n₂) = -6.845792
- Welch degrees of freedom ≈ 7.9838
- Two-tailed p ≈ 0.0001328.
Common mistakes
Use a paired test only for meaningfully matched observations.
Incorrect approach
Before 5, 10; after 6, 12 for the same two individuals: ignore the matching.
Correct approach
Analyse the paired changes 1, 2.
More checks before you submit
- Use paired analysis only when observations are meaningfully matched.
- Statistical significance is not the same as biological importance.
Method notes
Choose the test design before looking at the outcome. A statistical test does not repair poor sampling, lack of independence or confounding.