Free, forever – no sign-up, calculations stay in your browser. About me →
Statistics · Two means

T-test calculator.

Compare the means of two independent samples. Enter each sample’s mean, standard deviation and size and the calculator returns the t statistic, the degrees of freedom and the two-tailed p-value.

By Jean Borg · Founder & developerfreecalculators.pro · Malta · Updated June 2026
Two-sample t-test T, df and p-value Your data stays private

Two samples

Live

This is an independent two-sample t-test with pooled variance. Degrees of freedom is the two sample sizes added together, minus two.

t statistic

2.236

pooled, two independent samples

Degrees of freedom18
P-value (two-tailed)0.0382
At alpha 0.05Significant
Mean difference5

Assumes two independent samples with roughly equal variances and approximately normal data. Calculations run in your browser; nothing you enter is stored.

How it works

Comparing two means

A two-sample t-test asks whether the difference between two group means is bigger than you would expect from random sampling alone. It scales the difference in means by the pooled standard error, giving a t statistic.

The larger the t statistic in absolute terms, the stronger the evidence that the groups truly differ. The p-value turns that t and the degrees of freedom into a probability, which you compare to your significance threshold.

Reference

Critical t values.

The t value you must exceed for two-tailed significance at alpha 0.05, by degrees of freedom.

Degrees of freedomCritical t (0.05)
52.571
102.228
152.131
202.086
302.042
infinity (z)1.960

The full guide

The complete guide to the t-test.

What the t statistic means, how to read the p-value, and the assumptions behind it.

What the t statistic measures

The t statistic is the difference between the two sample means divided by the standard error of that difference. A t of zero means the means are identical; the further from zero, the more the samples diverge relative to their scatter.

Because it is standardised, you can compare it to a known t-distribution to judge significance.

Pooled standard error

This calculator pools the two sample variances, weighting each by its degrees of freedom, then uses that pooled value with both sample sizes to get the standard error. Pooling assumes the two populations have similar spread.

If the variances differ a lot, a Welch t-test, which does not pool, is more appropriate.

Reading the p-value

The two-tailed p-value is the probability of seeing a difference at least this large in either direction if the true means were equal. Below 0.05 it is usually called statistically significant, meaning the difference is unlikely to be chance alone.

Significance is not the same as importance; always look at the size of the mean difference too.

Assumptions to check

The t-test assumes the two samples are independent, drawn at random, and roughly normally distributed, with similar variances for the pooled version. With small, skewed samples those assumptions matter more.

For paired data, such as before-and-after measurements on the same subjects, use a paired t-test instead.

The formula

Difference
over noise.

The t statistic divides the gap between two means by their pooled standard error; the p-value comes from the t-distribution with n1 plus n2 minus 2 degrees of freedom.

P-value calculator ›
t_test
# Two-sample t-test (pooled)
sp2 = ((n1-1)s1^2 + (n2-1)s2^2) / (n1+n2-2)
t   = (m1 - m2) / sqrt( sp2 (1/n1 + 1/n2) )
df  = n1 + n2 - 2

# example
t = 2.236, df = 18, p = 0.0382

Questions

T-test questions.

How do I run a two-sample t-test?

+

Enter each group’s mean, standard deviation and size. The calculator pools the variances, computes the t statistic and degrees of freedom, and returns the two-tailed p-value.

What t value is significant?

+

It depends on the degrees of freedom, but a two-tailed test at alpha 0.05 needs about t = 2.09 at 20 degrees of freedom, falling toward 1.96 as the samples grow. The table on this page lists common thresholds.

What is the difference between pooled and Welch t-tests?

+

The pooled test assumes the two groups have equal variances; Welch’s test does not and adjusts the degrees of freedom. This calculator uses the pooled version.

When should I use a paired t-test instead?

+

Use a paired t-test when the two measurements come from the same subjects, such as before and after a treatment. This calculator is for two independent groups.

Is this t-test calculator free?

+

Yes. It is completely free with no sign-up, and every calculation runs locally in your browser, so nothing you enter is stored or sent anywhere.

About the developer

Jean Borg

Jean builds and maintains every calculator on freecalculators.pro from Malta, with a focus on tools that are fast, free and show their working. The t-test calculator runs a pooled independent two-sample test with an exact p-value.