t-test Calculator
Run a t-test online: one-sample, independent two-sample, or paired t-test. Enter your sample data or summary stats to get t-value, degrees of freedom, and p-value (one-tailed or two-tailed), plus formulas and interpretation.
Full original guide (expanded)
t-test Calculator
Choose the test type, enter sample statistics, and get t-value, degrees of freedom, and p-value (one- or two-tailed).
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.
Formula (LaTeX) + variables + units
','\
t = (x̄ − μ₀) / (s / √n) df = n − 1
sₚ² = ((n₁ − 1)s₁² + (n₂ − 1)s₂²) / (n₁ + n₂ − 2) t = (x̄₁ − x̄₂) / ( sₚ √(1/n₁ + 1/n₂) ) df = n₁ + n₂ − 2
t = (x̄₁ − x̄₂) / √( s₁²/n₁ + s₂²/n₂ ) df = ( s₁²/n₁ + s₂²/n₂ )² / [ (s₁²/n₁)²/(n₁−1) + (s₂²/n₂)²/(n₂−1) ]
t = d̄ / (sd / √n) df = n − 1
- PMI = private mortgage insurance (monthly) (currency)
- NIST — Weights and measures — nist.gov · Accessed 2026-01-19
https://www.nist.gov/pml/weights-and-measures - FTC — Consumer advice — consumer.ftc.gov · Accessed 2026-01-19
https://consumer.ftc.gov/
Last code update: 2026-01-19
- Initial audit spec draft generated from HTML extraction (review required).
- Verify formulas match the calculator engine and convert any text-only formulas to LaTeX.
- Confirm sources are authoritative and relevant to the calculator methodology.