T-Test Calculator

Choose the test, enter means, standard deviations and sample sizes, and see whether the result is significant at your chosen alpha.

Updated

Embed this calculator

Paste this code into your page. The calculator runs inside the frame and links back to the full version.

Keep the credit link in place. Do not resell the calculator.

Formula

  • One-sample and paired: t = (mean − μ0) ÷ (s ÷ √n), df = n − 1 (for paired, use the differences)
  • Welch two-sample: t = (x̄1 − x̄2 − μ0) ÷ √(s1²/n1 + s2²/n2)
  • Welch-Satterthwaite: df = (a + b)² ÷ (a² ÷ (n1 − 1) + b² ÷ (n2 − 1)), with a = s1²/n1, b = s2²/n2
  • Two-tailed p = 2 × P(T ≤ −|t|); reject H0 when p < α

Worked example

Welch test, group 1: mean 82, s 10, n 30; group 2: mean 76, s 12, n 25.

  • a = 100 ÷ 30 = 3.3333, b = 144 ÷ 25 = 5.76, standard error = √9.0933 = 3.0155
  • t = 6 ÷ 3.0155 = 1.9897
  • df = 9.0933² ÷ (3.3333² ÷ 29 + 5.76² ÷ 24) = 46.83
  • p = 0.0525, so at α = 0.05 the difference is not significant (critical t = 2.012).

Frequently asked questions

How is the one-sample t statistic calculated?

t = (x̄ − μ0) ÷ (s ÷ √n) with n − 1 degrees of freedom. For x̄ = 52, μ0 = 50, s = 6 and n = 25, t = 2 ÷ 1.2 = 1.667, df = 24 and p = 0.1086, so not significant at 0.05.

What is the Welch-Satterthwaite degrees of freedom?

For two samples with possibly unequal variances, df = (a + b)² ÷ (a² ÷ (n1 − 1) + b² ÷ (n2 − 1)), where a = s1² ÷ n1 and b = s2² ÷ n2. For 82 (s 10, n 30) against 76 (s 12, n 25), t = 1.990, df = 46.83 and p = 0.0525.

How do I run a paired t-test from summary statistics?

Take the difference within each pair, then enter the mean and standard deviation of those differences and the number of pairs. A mean difference of 1.2, standard deviation 2.5 and 16 pairs gives t = 1.92, df = 15, p = 0.0741.

What does the p-value mean?

It is the probability of a t value at least this extreme if the null hypothesis were true. It is not the probability that the null hypothesis is true. Compare it with α to decide, and consider the effect size as well. The test assumes independent observations and approximately normal data, or a reasonably large sample.