Saved

Press the star next to a tool's name to save it.

All my tools

T-Test Calculator

This t-test calculator runs Welch's, equal-variance, paired and one-sample t-tests on your data, giving the t statistic, degrees of freedom and p-value.

Restored your last values ·

Separate values with commas, spaces or new lines. For a paired test, list the pairs in the same order in both boxes.

Your data stays in your browser. Nothing is uploaded.

p-value

–

Enter your data and press Run t-test.

A t-test calculator tells you whether the difference between two averages, or between an average and a target value, is likely to be real or just chance. Paste your data, choose the kind of t-test, and this t-test calculator works out the t statistic, the degrees of freedom and the p-value, with a plain-language verdict at your chosen significance level. It handles Welch's two-sample test, the equal-variance (pooled) test, the paired test and the one-sample test.

How to use the t-test calculator

  1. Choose the test: two independent groups (Welch or equal variances), paired data, or one sample against a hypothesized mean.
  2. Paste the values for each group, separated by commas, spaces or new lines.
  3. Pick the alternative hypothesis: two-tailed, or one-tailed if you only care about one direction.
  4. Choose the significance level, usually 0.05.
  5. Press Run t-test.

What a t-test is

Student's t-test is any statistical hypothesis test in which the test statistic follows a Student's t-distribution when the null hypothesis is true. It's used to test whether the difference between groups is statistically significant. The t-distribution is used because the true spread of the population is unknown and has to be estimated from the sample, which adds uncertainty, especially with small samples.

The four tests

TestWhen to use itt statisticDegrees of freedom
Welch (two groups)Independent groups; variances may differ(x̄₁ − x̄₂) ÷ √(s₁²/n₁ + s₂²/n₂)Welch–Satterthwaite equation
Equal variances (pooled)Independent groups with similar spreads(x̄₁ − x̄₂) ÷ (sₚ √(1/n₁ + 1/n₂))n₁ + n₂ − 2
PairedThe same subjects measured twice, or matched pairs(mean of differences − μ0) ÷ (s_D / √n)n − 1
One sampleOne group against a set value μ0(x̄ − μ0) ÷ (s / √n)n − 1

Here sₚ is the pooled standard deviation, √[((n₁ − 1)s₁² + (n₂ − 1)s₂²) ÷ (n₁ + n₂ − 2)]. Welch's test is the default because it doesn't assume the two groups have the same variance, and when they do, it gives almost the same answer as the pooled test.

Worked example

Two teaching methods are tried with seven students each. Group A scores 82, 75, 90, 68, 77, 85 and 79; group B scores 70, 72, 65, 80, 68, 74 and 69.

  • Group A: mean 79.43, standard deviation 7.14
  • Group B: mean 71.14, standard deviation 4.85
  • Difference in means: 8.29
  • Welch's test: t = 2.541, df = 10.56, two-tailed p = 0.028
  • Equal-variance test: t = 2.541, df = 12, p = 0.026

At α = 0.05, the difference is significant: method A's higher scores are unlikely to be due to chance alone. If the same seven students had been tested twice instead, a paired test on these numbers would give t = 1.969 with 6 degrees of freedom and p = 0.096, not significant at 0.05.

Reading the p-value

The p-value is the probability of seeing a difference at least as large as yours if there were really no difference. A small p-value, below your significance level, suggests the difference is unlikely to be chance alone. A large p-value means your data don't show a clear difference; it doesn't prove the groups are the same. A one-tailed test halves the p-value when the difference is in the predicted direction, but choose it before looking at the data, not after.

Paired or independent?

A paired test is used when the samples are dependent: one group tested twice, such as before and after a treatment, or two groups matched pair by pair. Paired tests are a form of blocking and have more power than unpaired tests when the pairs are similar, because each subject acts as their own control. Use an independent test, Welch or pooled, when the two groups are made of different, unrelated subjects.

Assumptions

  • Independent observations within each group.
  • Roughly normal data, or large enough samples for the means to be roughly normal.
  • For the pooled test, similar variances; use Welch when one group's spread is much larger.
  • Numeric data measured on a meaningful scale.

Choosing the significance level

The significance level, written α, is the cut-off you set before running the test. It's the chance you accept of calling a difference real when it's really due to chance. A level of 0.05 is the most common choice in many fields. Use 0.01 when a false alarm would be costly, such as in medical or safety decisions, and 0.10 for early, exploratory work where you'd rather not miss a possible effect. Decide on the level in advance, and report the exact p-value as well as whether it passed, so readers can judge the result for themselves.

Effect size and sample size

Statistical significance and practical importance are different things. With very large samples, even a tiny difference can give a small p-value; with small samples, a large and important difference may not reach significance. That's why the calculator shows the difference in means and the standard error alongside the p-value. Look at the size of the difference in real units, such as points, kilograms or seconds, and ask whether it matters for your purpose. If your result isn't significant but the difference looks large, collecting more data may give a clearer answer.

Common mistakes

  • Using an independent test on paired data, which wastes power.
  • Choosing one-tailed after seeing the results.
  • Treating p > 0.05 as proof of no difference.
  • Ignoring the effect size. Report the difference in means too.

What next

Use this often? Add T-Test to your Home screen.

Frequently asked questions

What does the t-test calculator work out?

The t statistic, degrees of freedom and p-value for Welch's, equal-variance, paired or one-sample t-tests, with a verdict at your significance level.

Which t-test should I use for two groups?

Welch's test for independent groups, especially when spreads differ. Use the paired test when the same subjects are measured twice.

What does a p-value of 0.028 mean?

If there were really no difference, a result at least this extreme would happen about 2.8% of the time, so it's significant at the 0.05 level.

What is the formula for Welch's t-test?

t = (x̄₁ − x̄₂) ÷ √(s₁²/n₁ + s₂²/n₂), with degrees of freedom from the Welch–Satterthwaite equation.

Is my data uploaded?

No. The t-test is calculated in your browser.

What went wrong?

We only receive the reason you pick, never what you typed into the tool.

Thanks for your feedback.

More Math Tools