Quick Answer
A t-test compares means. For two samples, t = (mean₁ − mean₂) ÷ SE. With the example data, sample means of 13.8125 and 12.1750 give Welch's t ≈ 4.0217. If the p-value is below 0.05, the difference is called statistically significant.
Embed this calculator
Adjust the size if needed, then copy the code below into your page or blog. The calculator will load in an iframe and stay updated automatically.
Table of Contents
- T-Test Calculator
- Quick Answer
- Related Calculators
- How This T-Test Calculator Works
- How to Use the T-Test Calculator
- Core Formulas
- Key Terms
- Worked Example
- Real-Life Examples
- T-Test vs Z-Test
- Two-Tailed Critical t Values
- Choosing the Right Test
- Common Mistakes to Avoid
- Frequently Asked Questions
- References & Sources
How This T-Test Calculator Works
Choose the test, then paste your numbers. For two independent groups, use Welch's test (or the pooled test if the variances are equal). For before-and-after measurements on the same subjects, use the paired test. To compare one sample with a known value, use the one-sample test. The calculator finds the means, standard deviations, standard error, t statistic, degrees of freedom, p-value and a confidence interval for the difference.
Quick explanation: the t statistic measures the difference in standard-error units.
- Large |t|: the difference is large compared with the noise.
- Small p-value: such a difference would be unlikely if there were no real difference.
- Degrees of freedom: depend on sample sizes and set the shape of the t curve.
How to Use the T-Test Calculator
- Choose the type of t-test.
- Paste sample 1 and, if needed, sample 2.
- For a one-sample test, enter the hypothesized mean.
- Choose the tail and significance level.
- Press Calculate and read t, df, the p-value and the interval.
Core Formulas
- One-sample: t = (x̄ − μ₀) ÷ (s ÷ √n), df = n − 1
- Paired: t = d̄ ÷ (s_d ÷ √n), df = n − 1
- Welch: t = (x̄₁ − x̄₂) ÷ √(s₁²/n₁ + s₂²/n₂), with the Welch–Satterthwaite df
- Pooled: sp² = ((n₁ − 1)s₁² + (n₂ − 1)s₂²) ÷ (n₁ + n₂ − 2), df = n₁ + n₂ − 2
- Confidence interval: difference ± t* × SE
Key Terms
- t statistic: the difference divided by its standard error.
- Degrees of freedom: a number based on sample size that sets the t curve's shape.
- p-value: the chance of a result at least this extreme if the null hypothesis is true.
- Null hypothesis: the starting assumption, usually no difference.
- Standard error: the standard deviation of a sample mean or difference.
Worked Example
Test whether a mean of 52 from 16 scores with SD 8 differs from 48.
- SE = 8 ÷ √16 = 2
- t = (52 − 48) ÷ 2 = 2, with df = 15
- The two-tailed p-value is about 0.064, so at α = 0.05 the difference is not significant
Real-Life Examples
- A/B tests: compare average order values between two page designs.
- Medicine: compare blood pressure before and after a treatment with a paired test.
- Quality control: check whether parts match a target length with a one-sample test.
- School: compare test scores between two classes.
T-Test vs Z-Test
- T-test: used when the population standard deviation is unknown, which is most of the time.
- Z-test: used when the population standard deviation is known.
- Large samples: the t distribution gets very close to the normal curve.
Two-Tailed Critical t Values
Values from the t distribution.
| df | α = 0.10 | α = 0.05 | α = 0.01 |
|---|---|---|---|
| 1 | 6.314 | 12.706 | 63.657 |
| 5 | 2.015 | 2.571 | 4.032 |
| 10 | 1.812 | 2.228 | 3.169 |
| 15 | 1.753 | 2.131 | 2.947 |
| 20 | 1.725 | 2.086 | 2.845 |
| 30 | 1.697 | 2.042 | 2.750 |
| 60 | 1.671 | 2.000 | 2.660 |
| 120 | 1.658 | 1.980 | 2.617 |
Choosing the Right Test
- Different people in each group: two-sample test (Welch by default).
- Same people measured twice: paired test.
- One group against a target: one-sample test.
- Direction known in advance: a one-tailed test, decided before seeing the data.
- Very skewed data or outliers: consider a non-parametric test such as the Mann-Whitney U test instead.
Common Mistakes to Avoid
- Using a two-sample test on paired data. Paired data need the paired test.
- Choosing the tail after seeing the data. Decide before you look.
- Assuming equal variances. Welch's test is safer when unsure.
- Treating p > 0.05 as proof of no difference. It only means the evidence is not strong enough.
- Ignoring effect size. A tiny difference can be significant with huge samples.
Frequently Asked Questions
A test that checks whether a mean, or the difference between two means, is larger than chance would explain.
Two separate groups: Welch. Same subjects twice: paired. One group against a value: one-sample.
The chance of seeing a difference this large if there were really no difference.
A two-sample t-test that does not assume equal variances.
n − 1 for one-sample and paired tests, n₁ + n₂ − 2 for pooled, and the Welch–Satterthwaite formula for Welch.
There is no fixed minimum, but small samples need roughly normal data.
Yes, as numbers, but for proportions a z-test for proportions is often better.
A range of plausible values for the true mean difference.
By the usual rule, p must be below α to be significant.
ANOVA compares three or more groups. With two groups, it gives the same result as a pooled t-test.
Yes. Copy a column and paste it into the box.
From the exact t distribution using the incomplete beta function.
References & Sources
| Source | Used For | Link |
|---|---|---|
| Wikipedia, Student's t-test | One-sample, paired, pooled and Welch t-tests. | https://en.wikipedia.org/wiki/Student%27s_t-test |
| NIST/SEMATECH e-Handbook, Two-Sample t-Test for Equal Means | Formulas and assumptions. | https://www.itl.nist.gov/div898/handbook/eda/section3/eda353.htm |