Account

What new tool do you want?

Math & Education

T-Test Calculator (Two Samples)

Compare the means of two groups with Welch's t-test (or Student's pooled test) from raw data — t-statistic, degrees of freedom, p-value and mean difference.

How to use

  1. 1Paste the values for group A and group B.
  2. 2Choose Welch's test (unequal variances, recommended) or Student's pooled test.

How it's calculated

Welch: t = (x̄₁ − x̄₂) ÷ √(s₁²/n₁ + s₂²/n₂), df by the Welch–Satterthwaite equation. Student: pooled variance with df = n₁ + n₂ − 2.

Frequently asked questions

Welch or Student?

Welch's test doesn't assume equal variances and performs well even when they are equal, so many statisticians recommend it as the default.

What about paired data?

For before/after measurements on the same subjects, use a paired t-test: compute the differences and test whether their mean is zero.

How much data do I need?

The t-test is fairly robust, but very small samples (under ~10 per group) with skewed data can mislead.

Why Welch's test doesn't assume equal variance

Student's pooled t-test blends both groups' variances into one number (sp) before computing the standard error, which is only sound if the two groups really do vary by similar amounts. Welch's test keeps the variances separate — se² = s₁²/n₁ + s₂²/n₂ — and adjusts the degrees of freedom downward using the Welch-Satterthwaite equation to compensate. Because Welch performs about as well as Student's test when variances happen to be equal, but far better when they aren't, it's the safer default rather than a special-case correction.

Degrees of freedom aren't always a whole number

Student's pooled test gives clean integer degrees of freedom (n₁ + n₂ − 2, so 10 for two groups of 6). Welch's comes from a ratio of variance terms and is almost never a whole number: for this tool's own default data (group A averaging 12.32, group B averaging 13.48), Welch's test gives t ≈ −3.4775 with df ≈ 9.42 — just below the pooled test's 10 — which reflects the two groups' variances being slightly uneven. Both methods agree the difference is significant here (p well under 0.05), but the df and exact p-value shift depending on which assumption you make.

This tool assumes independent, unpaired groups

Both formulas here treat group A and group B as unrelated samples — different people, different units. If your data is actually paired (the same subjects measured before and after a treatment), this test throws away information: the right approach is to compute each pair's difference and run a one-sample t-test on those differences, which is a separate calculation from what's done here.

The significant label is stuck at 0.05, and the difference is always A minus B

Welch is the test that opens, and each group has to have at least two numbers or I get stopped before any statistic appears. The hint under the p-value says significant at 0.05 or not significant at 0.05, and that cutoff does not move. There is no place to ask for 0.01, so a p-value of 0.04 is labeled significant even if my lab uses a stricter bar. The mean difference is group A minus group B, so a negative number means B is higher, not that the test failed. Switching to the pooled test changes the degrees of freedom to a whole number, one less than the combined count, while Welch can leave a fractional one.

Related tools

More: Math & Education