Which t-test should I use?
Pick the t-test from how the data were collected: one group against a known value, two separate groups, or the same subjects measured twice.[2][1]
| Situation | Test | Standard error | df |
|---|---|---|---|
| One sample vs a target value (μ₀) | One-sample t | s ÷ √n | n − 1 |
| Two independent groups | Welch t (default) | √(s₁²/n₁ + s₂²/n₂) | Welch–Satterthwaite |
| Two independent groups, equal spreads assumed | Pooled (Student) t | sₚ √(1/n₁ + 1/n₂) | n₁ + n₂ − 2 |
| Same subjects before and after, or matched pairs | Paired t | s_d ÷ √n | pairs − 1 |
Welch’s test is the safer default for two groups because it does not assume equal variances; when the spreads and sizes are similar it gives almost the same answer as the pooled test.[1] For the example classes, Welch gives t = 2.1653 (df 50.98, p = 0.0351) and the pooled test t = 2.1487 (df 51, p = 0.0364).
How the t-test works
t = (difference − hypothesized difference) ÷ standard errorWelch df = (s₁²/n₁ + s₂²/n₂)² ÷ [(s₁²/n₁)²/(n₁ − 1) + (s₂²/n₂)²/(n₂ − 1)]
Worked examples
One-sample: 36 students average 105 with SD 15; is the mean different from 100? SE = 15 ÷ 6 = 2.5, t = 5 ÷ 2.5 = 2, df = 35, two-tailed p = 0.0533: not significant at 0.05, just.
Paired: 12 students improve by an average of 3.2 points (SD of the differences 4.1). t = 3.2 ÷ (4.1 ÷ √12) = 2.704, df = 11, p = 0.0205.
The p-value is the tail area of the t distribution beyond your t.[3] The p-value calculator does that step alone if you already have t and df.
Reading the result
Reject the null hypothesis when p is below your significance level α (usually 0.05).[6] The calculator adds what the p-value leaves out: a confidence interval for the difference and Cohen’s d, the difference in standard-deviation units. For the two classes, the 95% interval for the difference is 0.42 to 11.18 points and d = 0.59.[5]
Raw data or summariesChoose “The raw numbers” to paste each group’s values; the calculator computes the means, SDs and sizes for you. For a paired test, list both measurements in the same order, and it works with the differences.
Assumptions to check
- Independence: each value comes from a different subject (or a different pair, for the paired test).
- Roughly normal data, or a large enough sample: with fewer than about 30 per group, look for strong skew or outliers in the statistics calculator.
- Equal variances only for the pooled test. If one SD is much larger than the other, use Welch.
Common t-test mistakes
- Running a two-sample test on paired data. Before/after scores from the same students need the paired test, which is usually much more sensitive.
- Choosing a one-sided test after seeing the data. Decide the direction first.
- Reporting only “p < 0.05”. Give t, df, p, the interval and the effect size. A confidence interval for each group’s mean is a useful companion.
How we check this calculator
Tests run before every update: a one-sample case with t = 2 and df = 35 must give p = 0.0533; Welch and pooled tests must agree exactly when sizes and SDs are equal; the Welch df is checked against a hand calculation; the t distribution matches NIST critical values to 10 digits.[4]
- 14 November 2026: page and calculator published.
More statistics calculators
- Statistics calculatorMean, median, mode, SD, quartiles and outliers
- Standard deviation calculatorSample and population SD, step by step
- Z-score calculatorz, percentile and area under the normal curve
- P-value calculatorFrom z, t, chi-square or F
- Confidence interval calculatorMeans and proportions, t or z
- Binomial distribution calculatorExactly, at most, at least x successes
Frequently asked questions
What is the difference between a paired and a two-sample t-test?
A paired test compares two measurements on the same subjects (before and after) by testing the mean of the differences. A two-sample test compares two separate groups.
Should I use Welch’s t-test or Student’s t-test?
Use Welch’s test unless you have a good reason to assume equal variances. It is accurate when the spreads differ and nearly identical to Student’s test when they do not.
How do I calculate degrees of freedom for a t-test?
n − 1 for a one-sample or paired test (n = number of pairs), n₁ + n₂ − 2 for the pooled test, and the Welch–Satterthwaite formula for Welch’s test, which usually gives a non-whole number.
What does a t value mean?
How many standard errors the observed difference is from the hypothesized one. Values beyond about ±2 are significant at 5% for moderate sample sizes.
Can I run a t-test from means and standard deviations only?
Yes. Enter each group’s mean, SD and size. The raw data are only needed if you have not computed those yet.
Sources
- 1.3.5.3 Two-Sample t-Test for Equal Means
- Introductory Statistics 2e, 10.1 Two Population Means with Unknown Standard Deviations
- 1.3.6.6.4 t Distribution
- 1.3.6.7.2 Critical Values of the Student’s t Distribution
- The ASA Statement on p-Values: Context, Process, and Purpose (Wasserstein and Lazar)
- Introductory Statistics 2e, 9.2 Outcomes and the Type I and Type II Errors