Skip to content
Press Equals

T-Test Calculator

Means of 82 and 77, SDs 8 and 9, samples of 25 and 28: Welch's t = 2.1412, p = 0.037058, significant at the 5% level.

Run a one-sample or two-sample t-test (Welch or pooled) from means, standard deviations and sample sizes to get the t statistic, degrees of freedom and p-value.

Result

p-value

0.08502

t statistic
1.7532
Degrees of freedom
56.17
Difference in means
5
Standard error
2.8519
Result
Not significant at the 5% level (p ≥ 0.05)

What this calculator does

A t-test checks whether a difference in means is bigger than chance would explain. This calculator runs a two-sample t-test (Welch's or pooled) or a one-sample t-test straight from summary statistics, the means, standard deviations and sample sizes, and gives the t statistic, degrees of freedom and p-value.

How to use it

  1. Choose two samples or one sample.
  2. Enter each sample's mean, standard deviation and size. For one sample, enter the mean to test against.
  3. For two samples, choose Welch's test (unequal variances, the safer default) or pooled (equal variances).
  4. Choose a two-tailed test, or a one-tailed test in the direction you expected.

How to calculate a t-test

  • Welch: t = (x̄₁ − x̄₂) ÷ √(s₁²/n₁ + s₂²/n₂), with Welch–Satterthwaite degrees of freedom
  • Pooled: t = (x̄₁ − x̄₂) ÷ (sₚ √(1/n₁ + 1/n₂)), with sₚ² = ((n₁ − 1)s₁² + (n₂ − 1)s₂²) ÷ (n₁ + n₂ − 2) and n₁ + n₂ − 2 degrees of freedom
  • One sample: t = (x̄ − μ₀) ÷ (s ÷ √n), with n − 1 degrees of freedom
  • The p-value comes from Student's t distribution with those degrees of freedom.

Examples

Example 1: Comparing two classes. One class of 25 averaged 82 (SD 8) and another of 28 averaged 77 (SD 9). Welch's test gives t = 2.1412 with 51 degrees of freedom and p = 0.037058: significant at the 5% level.

Example 2: One sample against a target. 36 measurements average 103 with an SD of 12. Against a target of 100, t = 3 ÷ (12 ÷ 6) = 1.5 and p = 0.142582, not significant.

Tips

  • Significant isn't the same as important. With big samples, tiny differences can be significant.
  • Use a one-tailed test only if you chose the direction before seeing the data.
  • The t-test assumes roughly normal data or samples of about 30 or more. For a z-score's p-value, use the p-value calculator; for an interval, the confidence interval calculator.

Common questions

How do I do a t-test from means and standard deviations?

Enter both means, standard deviations and sample sizes. Means of 82 and 77, SDs of 8 and 9, with 25 and 28 people give t = 2.1412 and p = 0.037058 with Welch's test.

Welch or pooled t-test?

Welch's test doesn't assume the two groups have the same variance and is the safer default. The pooled (Student's) test is slightly more powerful when the variances really are equal.

What does the p-value mean?

The chance of a difference at least this large if the true means were equal. Below 0.05 is usually called significant.

How we check this calculator

  • Tested against 4 reference answers worked from published sources or by hand,such as “t = 2.228 with 10 df is the 5% two-tailed critical value in t tables”.
  • All 2 worked examples in the article above are run through this calculator, so the two can't disagree.
  • Every input is tried at its smallest and largest values and with random numbers, and must never crash or show a broken number.
  • These checks run automatically before any change goes live.

Spotted a wrong number? Tell us and we'll fix it. See how the calculators are tested.

Updated