Statistics

T-test Calculator

Compare two independent samples, reporting the t statistic, degrees of freedom, and two-tailed p-value.

t-testhypothesis testp-value
Two-sample t-test (Welch)

Compare two independent samples with unequal variances.

Mean difference
5.2
t statistic
3.5546
Degrees of freedom
6.23
Two-tailed p-value
0.011267

Welch’s t statistic

t = (ȳ₁ − ȳ₂) / √(s₁²/n₁ + s₂²/n₂)
ν ≈ (s₁²/n₁ + s₂²/n₂)² / [s₁⁴/(n₁²(n₁ − 1)) + s₂⁴/(n₂²(n₂ − 1))]

Welch’s adjustment is robust when variances differ or sample sizes are unequal, making it a safe default.

How to use

  1. Enter the two samples as comma-separated lists.
  2. Ensure each sample has at least two observations.
  3. Review the mean difference, t statistic, degrees of freedom, and p-value.

Example

Input: Sample A = 23,21,25,20,27; Sample B = 18,19,17,20,16

Output: t ≈ 4.03, ν ≈ 7.8, p ≈ 0.0041

FAQ & notes

Is this a paired test?

No. The calculator runs Welch’s unpaired test. Pair your data manually if observations are matched.

How accurate is the p-value?

P-values rely on the Student’s t CDF via the incomplete beta function, giving accurate probabilities for common degrees of freedom.