t-test Calculator

Choose the t-test type, enter your sample statistics, and get the t-value, degrees of freedom, and p-value (one- or two-tailed). This works for small samples and unknown population variance.

Used for interpretation only.

Results

t statistic

Degrees of freedom

p-value

How this t-test works

This calculator follows standard Student's t-test formulas.

1. One-sample t-test

Used to test whether a sample mean differs from a hypothesized population mean μ₀.

t = (x̄ − μ₀) / (s / √n)
df = n − 1

2. Independent two-sample t-test

Used to test whether two independent groups have different means.

Equal variances (pooled):

sₚ² = ((n₁ − 1)s₁² + (n₂ − 1)s₂²) / (n₁ + n₂ − 2)
t = (x̄₁ − x̄₂) / ( sₚ √(1/n₁ + 1/n₂) )
df = n₁ + n₂ − 2

Welch (unequal variances):

t = (x̄₁ − x̄₂) / √( s₁²/n₁ + s₂²/n₂ )
df = ( s₁²/n₁ + s₂²/n₂ )² / [ (s₁²/n₁)²/(n₁−1) + (s₂²/n₂)²/(n₂−1) ]

3. Paired t-test

Used for before/after or matched-subject designs. Let d̄ be the mean of the differences and sd their SD.

t = d̄ / (sd / √n)
df = n − 1

Interpreting the p-value

If p < α (typically α = 0.05), you reject the null hypothesis and conclude that the means differ in the direction specified.