T-Test Calculator
Reviewed by CalcMulti Editorial Team·Last updated: ·← Statistics Hub
The t-test is one of the most widely used statistical hypothesis tests. It determines whether there is a significant difference between a sample mean and a known value (one-sample t-test) or between two independent groups (two-sample t-test).
This calculator computes the t-statistic, degrees of freedom, and p-value, then interprets the result at the 0.05 significance level. Use it for A/B testing, clinical comparisons, before/after studies, and research hypothesis testing.
Formula
One-sample: t = (x̄ − μ₀) / (s / √n) Two-sample: t = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂)
- x̄
- sample mean
- μ₀
- hypothesised population mean (one-sample test)
- s
- sample standard deviation
- n
- sample size
- df
- degrees of freedom (n−1 for one-sample; Welch approximation for two-sample)
The value you are testing your sample mean against
When to Use Each t-Test Type
| Test | Use when | Example |
|---|---|---|
| One-sample | Comparing a sample mean to a known constant | Is our product weight significantly different from the stated 500g? |
| Two-sample (independent) | Comparing means of two unrelated groups | Do male and female students score differently on the same test? |
| Paired (not here) | Same subjects measured twice (before/after) | Did blood pressure change after treatment in the same patients? |
Common Mistakes in t-Tests
Confusing statistical and practical significance
A statistically significant result (p < 0.05) does not mean the difference is large or meaningful. With very large samples, tiny differences become significant. Always report effect size (Cohen's d) alongside p-values.
Using paired t-test data in a two-sample test
If the same subjects were measured twice, you must use a paired t-test — not two-sample. Using two-sample on paired data reduces power and may give the wrong answer.
Checking significance after peeking at data
Deciding to run a t-test after seeing the data direction inflates Type I error. Pre-register your hypothesis and analysis plan before collecting data.
Related Calculators
p-value from z or t statistic
Z-Score CalculatorStandardise a value
Normal Distribution CalculatorBell curve probabilities
Sample Size CalculatorHow many subjects needed
Standard Error CalculatorSE of the mean — used in t-test formula
Correlation CalculatorPearson r for two variables
Statistics HubAll statistics calculators
Disclaimer
This calculator is for educational and exploratory purposes only. Statistical significance does not imply practical importance. Consult a qualified statistician before making decisions based on hypothesis tests.