Skip to content
FiftyCalc Free calculators for all 50 states

T-Test Calculator

Test cases replayed : 3 of 3 match · Methodology · No outside source listed

Enter the mean, standard deviation and size of two independent samples to test whether their means differ.

Result

Sample figures

Two-tailed p-value—

Difference of means (group 1 − group 2) —

  • Standard error of the difference—
  • t statistic—
  • Degrees of freedom—

Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.

T-Test Calculator

Group 1 mean: enter a number. Prefilled example: 24.5.

Group 1 standard deviation: enter 0 or more. Prefilled example: 4.2.

Group 1 sample size: enter 2 or more. Prefilled example: 30.

Group 2 mean: enter a number. Prefilled example: 22.1.

Group 2 standard deviation: enter 0 or more. Prefilled example: 5.1.

Group 2 sample size: enter 2 or more. Prefilled example: 28.

Variance assumption: choose Unequal variances (Welch's t-test) or Equal variances (Student's pooled t-test). Prefilled example: Unequal variances (Welch's t-test).

How to use this calculator

Fill in the fields in this order; each step takes you to its field.

  1. Group 1 mean: enter a number.
  2. Group 1 standard deviation: enter 0 or more.
  3. Group 1 sample size: enter 2 or more.
  4. Group 2 mean: enter a number.
  5. Group 2 standard deviation: enter 0 or more.
  6. Group 2 sample size: enter 2 or more.
  7. Variance assumption: choose Unequal variances (Welch's t-test) or Equal variances (Student's pooled t-test).
  8. Read the result: Two-tailed p-value; the panel also shows Difference of means (group 1 − group 2), Standard error of the difference, t statistic and Degrees of freedom.

How this calculator works

t = (x̄₁ − x̄₂) ÷ SE. Welch's test uses SE = √(s₁²/n₁ + s₂²/n₂) and the Welch–Satterthwaite degrees of freedom ν = (s₁²/n₁ + s₂²/n₂)² ÷ [(s₁²/n₁)²/(n₁ − 1) + (s₂²/n₂)²/(n₂ − 1)].

Student's pooled test uses the pooled variance s_p² = [(n₁ − 1)s₁² + (n₂ − 1)s₂²] ÷ (n₁ + n₂ − 2), SE = √(s_p²(1/n₁ + 1/n₂)) and ν = n₁ + n₂ − 2.

The two-tailed p-value is P(|T| ≥ |t|) for Student's t distribution with ν degrees of freedom, computed with the regularized incomplete beta function.

Worked example

Group 1 mean24.5
Group 1 standard deviation4.2
Group 1 sample size30
Group 2 mean22.1
Group 2 standard deviation5.1
Group 2 sample size28
Variance assumptionUnequal variances (Welch's t-test)
Difference of means (group 1 − group 2)2.4
Standard error of the difference1.2316
t statistic1.9486
Degrees of freedom52.438
Two-tailed p-value0.0567

Frequently asked questions

Should I use Welch's or Student's t-test?

Welch's test is the safer default: it stays valid when the two groups have different variances, and gives almost the same answer as the pooled test when they do not.

What does the t-test assume?

Independent observations and, for small samples, roughly normal data in each group. With larger samples the test is robust to moderate non-normality.

Questions answered

Related calculators