Skip to content
Omnikalc

Two-sample t-test: is the difference between the means significant?

Compare two independent groups from their means, standard deviations and sizes with Welch's or Student's t-test: t statistic, degrees of freedom, p-value, confidence interval and effect size.

Updated on
Your inputs

Value out of range

Value out of range

Value out of range

Value out of range

Value out of range

Value out of range

Method

Results

p-value

0.07914

Not significant: p is at or above α, so the data do not reject the null hypothesis
t statistic
1.786
Degrees of freedom
59.21
Critical t for this test
2.001
Difference of the means
5.000
Confidence interval of the difference, lower bound (1 − α)
-0.600
Confidence interval of the difference, upper bound
10.600
Effect size, Cohen's d (pooled SD)
0.451

What the two-sample t-test does

The two-sample t-test checks whether the means of two independent groups differ by more than chance would explain. You only need each group’s mean, standard deviation and size, for example from a published table or a spreadsheet summary.

The formulas

Welch’s t-test (the safer default, which does not assume equal variances):

t = (x̄₁ − x̄₂) ÷ √(s₁²/n₁ + s₂²/n₂)

with the Welch–Satterthwaite degrees of freedom:

df = (s₁²/n₁ + s₂²/n₂)² ÷ [(s₁²/n₁)²/(n₁ − 1) + (s₂²/n₂)²/(n₂ − 1)]

Student’s t-test pools the two variances, assuming they are equal, and uses df = n₁ + n₂ − 2.

The p-value comes from Student’s t distribution with those degrees of freedom.

Example

Group 1: mean 75, SD 10, n = 30. Group 2: mean 70, SD 12, n = 32.

  • standard error: √(100/30 + 144/32) ≈ 2.80;
  • t = 5 ÷ 2.80 ≈ 1.79, with about 59.2 degrees of freedom;
  • two-tailed p ≈ 0.079: not significant at α = 0.05;
  • 95% confidence interval of the difference: about −0.6 to 10.6, which includes 0;
  • Cohen’s d ≈ 0.45, a small to medium effect.

Reading the result

  • p below α: the difference is statistically significant; the data are unlikely if the true means were equal.
  • p at or above α: the data are compatible with no difference. This does not prove the means are equal; the study may simply be too small.
  • The confidence interval shows the plausible size of the difference, which matters more than the p-value alone.

One or two tails?

Use a two-tailed test unless you decided before seeing the data that only one direction matters. A one-tailed test halves the p-value, so choosing it after the fact inflates false positives.

Assumptions

  • The two groups are independent. For before-and-after measurements on the same people, use the paired (one-sample) t-test on the differences.
  • Each group’s values are roughly normal, or the samples are large enough (often 30 or more per group) for the central limit theorem to apply.
  • For Student’s version, the variances are similar. Welch’s test works well in both cases, which is why many statisticians recommend it by default.

For strongly skewed data or small samples, a non-parametric test such as the Mann–Whitney U test is an alternative.

Frequently asked questions

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

Welch's test is the safer default: it stays accurate when the two variances differ and loses almost nothing when they are equal.

Can I run a t-test from summary statistics?

Yes. The mean, standard deviation and size of each group are all the test needs, so you can check published results.

What does a p-value of 0.08 mean?

Data this extreme would occur 8% of the time if the true means were equal. At α = 0.05 that is not significant, but it is not proof of no difference.

What is Cohen's d?

The difference in means divided by the pooled standard deviation. About 0.2 is small, 0.5 medium and 0.8 large.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.