Skip to content

T-Test Calculator

Paste or type two groups of numbers to test whether their means differ…

Paste or type two groups of numbers to test whether their means differ: Welch’s t-test by default, Student’s if you choose, with the p-value shaded on the t curve.

Enter

Read 10 values; left out the header row (“Lectures”).

Read 11 values; left out the header row (“Practice tests”).

Test
More optionsTwo-sided, 95% confidence
Hypothesis
Confidence level

The significance level is 1 − the confidence level (0.05 at 95%). Welch’s test is the safer default; Student’s assumes both groups have the same spread.

ExampleP-value

0.00031

Lectures averages 8.982 less than Practice tests (difference −8.982, 95% CI −13.26 to −4.708). Significant at the 5% level (p < 0.05).

Paste your own numbers to test them.

Lectures n = 10Practice tests n = 11

Every value is a dot and the box is the middle half; the diamond is the mean with its confidence interval.

The distribution the statistic follows if there were no difference; the shaded area beyond it is the p-value.

t (Welch), df
−4.3995, 18.95
Cohen’s d (Hedges g)
−1.908 (−1.831)
Difference, 95% CI
−8.982 [−13.26 to −4.708]
How this works: 9 sources,

How this works

Method

A two-sample t-test asks whether two independent groups have different means, judged against how much the values vary inside each group. With the example’s two classes, the class taught with practice tests averaged 81.2 and the lecture class 72.2. That 9-point gap is about four times its standard error, which is why the p-value is so small: a gap that big would be rare if both methods worked equally well. Full method

How it’s tested

4 worked examples for this page are checked by automated tests before every release: given the inputs, the tool must show the expected answer.

Privacy

On your device. Nothing you enter or open leaves this browser. About privacy labels

Changes

  • First published: live curves with draggable cut-offs, and tests on pasted data (t-tests, ANOVA, chi-square, Fisher’s exact, correlation, regression, A/B), checked against SciPy.

Every change on What’s new

How we make toolsReport a mistake

How the two-sample t-test works

A two-sample t-test asks whether two independent groups have different means, judged against how much the values vary inside each group. With the example’s two classes, the class taught with practice tests averaged 81.2 and the lecture class 72.2. That 9-point gap is about four times its standard error, which is why the p-value is so small: a gap that big would be rare if both methods worked equally well.

The statistic is t = (mean₁ − mean₂) ÷ SE. Welch’s version, the default here, takes the standard error as √(s₁²/n₁ + s₂²/n₂) and works out fractional degrees of freedom from both groups, so it stays honest when one group is more spread out or larger than the other. Student’s original version pools the two variances first; it is slightly more powerful when the spreads really are equal, and noticeably wrong when they are not and the groups differ in size.

A p-value says nothing about how big the difference is, so the answer also gives the confidence interval of the difference and Cohen’s d, the gap measured in pooled standard deviations. Hedges’ g is d with a small-sample correction. Around 0.2 is usually called small, 0.5 medium and 0.8 large, but what matters is whether the difference is big enough to care about in your field.

t = (x̄₁ − x̄₂) ÷ √(s₁²/n₁ + s₂²/n₂) · Welch df = (s₁²/n₁ + s₂²/n₂)² ÷ Σ (sᵢ²/nᵢ)²/(nᵢ − 1)

The same difference at different sample sizes

Two groups with means 5 apart and a standard deviation of 10 in each (d = 0.5): how the t statistic, the p-value and the 95% interval change with the number in each group (Welch’s test).

Two groups with means 5 apart and a standard deviation of 10 in each (d = 0.5): how the t statistic, the p-value and the 95% interval change with the number in each group (Welch’s test).
Per grouptdfp-value95% CI of the difference
50.79180.452−9.58 to 19.58
101.118180.2783−4.4 to 14.4
151.369280.1818−2.48 to 12.48
201.581380.1221−1.4 to 11.4
301.936580.0577−0.17 to 10.17
502.5980.01411.03 to 8.97
642.8281260.00541.5 to 8.5
1003.5361980.00052.21 to 7.79
20053988.61e-73.03 to 6.97
5007.9069987.03e-153.76 to 6.24
Show all 11 rows
1,00011.1819983.43e-284.12 to 5.88

Common questions

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

Welch’s, unless you have a good reason to believe both groups have the same spread. It costs almost nothing when the spreads are equal and protects you when they aren’t. Excel’s T.TEST type 3, R’s t.test default and SciPy’s ttest_ind with equal_var=False are all Welch’s test.

My groups have different sizes. Is that a problem?

No, the test handles unequal groups. It matters more for Student’s version, whose pooled variance gives the larger group more say; another reason to stay with Welch.

What if my data aren’t normal?

With 30 or so values per group the t-test is robust to moderate skew, because it is about means. For small, skewed samples or ratings on a scale, the Mann-Whitney U test compares the groups by rank instead.

I only have the means and standard deviations. Can I still run it?

Yes. Switch “Enter” to “Mean and SD” and type each group’s size, mean and standard deviation; the test needs nothing else. That is also what a shared link sends when your data are too big for a link.