Skip to content
RK Calculator
Menu

T-Test Calculator

Run a one-sample or two-sample t-test from summary statistics: t, degrees of freedom and p-values, with Student's or Welch's test.

Change the values and press Calculate to work out your own figures.

One-sample t-test

Compare a sample mean with a population mean.

About population mean (μ₀)The mean you are testing against.
About sample meanMean of the (first) sample.
About sample standard deviationSD of the (first) sample.
About sample sizeSize of the (first) sample.
Result
Two-tailed p-value
0.04804409326
t statistic
2.083333333
Degrees of freedom
24
Left-tailed p
0.9759779534
Right-tailed p
0.02402204663
Standard error
2.4
Difference of means
5

t = 2.083333333 with 24 degrees of freedom gives a two-tailed p-value of 0.04804409326.

Show the working
  1. t = difference ÷ standard error = 2.083333333
  2. df = 24
  3. p = 2 × P(T > |t|) = 0.04804409326

Two-sample t-test (unpaired)

Compare the means of two independent samples.

About sample meanMean of the (first) sample.
About sample standard deviationSD of the (first) sample.
About sample sizeSize of the (first) sample.
About second sample meanMean of the second sample.
About second sample standard deviationSD of the second sample.
About second sample sizeSize of the second sample.
About variancesWelch's test is safer when the samples' spreads differ.
Result
Two-tailed p-value
0.2368505634
t statistic
-1.20879577
Degrees of freedom
28
Left-tailed p
0.1184252817
Right-tailed p
0.8815747183
Pooled standard deviation
4.272001873
Standard error of the difference
1.654539211
Difference of means
-2

t = -1.20879577 with 28 degrees of freedom gives a two-tailed p-value of 0.2368505634.

Show the working
  1. t = difference ÷ standard error = -1.20879577
  2. df = 28
  3. p = 2 × P(T > |t|) = 0.2368505634

How to use it

Compare a sample mean with a population mean. Compare the means of two independent samples.

Probabilities can be typed as decimals, fractions or percentages. Show the working gives the formula with your numbers in it.

Key facts

t = (x̄₁ − x̄₂) ÷ SE;  pooled s_p² = ((n₁−1)s₁² + (n₂−1)s₂²) ÷ (n₁+n₂−2)

Student's or Welch's?

Student's test assumes the two populations have the same variance. Welch's test doesn't and adjusts the degrees of freedom; many statisticians use it by default.

Questions

What does the p-value tell me?

How surprising the difference would be if the population means were equal.

Do I need the raw data?

No; the means, standard deviations and sizes are enough.

Formulas

t = (x̄₁ − x̄₂) ÷ SE;  pooled s_p² = ((n₁−1)s₁² + (n₂−1)s₂²) ÷ (n₁+n₂−2)

Sources

Limitations

  • Probabilities can be typed as decimals (0.25), fractions (1/4) or percentages (25%).

Formula version 0.1.0Reviewed