T-Test Calculator

Is That Difference Real, or Just Noise?

Whenever you compare a sample mean against a target, or compare two groups' means against each other, the t-test is the standard tool for deciding whether the difference you're seeing is large relative to the natural variability in the data — or small enough that it could plausibly be chance. This calculator handles all three common variants: one-sample, two-sample (Welch's), and paired.

The Formulas

One-sample: t = (x̄ − μ₀) ÷ (s ÷ √n)
Two-sample (Welch's): t = (x̄1 − x̄2) ÷ √(s1²÷n1 + s2²÷n2)
Paired: t = d̄ ÷ (s_d ÷ √n)

The two-sample version uses Welch's formula, which does not assume the two groups have equal variance — a safer default than the classic pooled-variance t-test. The paired version works on the differences between matched observations (before/after measurements on the same subject, for example).

Worked Example: One-Sample T-Test

Testing whether a group of 8 measured heights (in cm) differs from a hypothesized population mean of 170:

One-sample t-test, values: 172, 168, 175, 170, 180, 165, 178, 172
Sample meant-statisticdfTwo-tailed p-value
172.51.41070.2013

With p = 0.2013, well above 0.05, there isn't enough evidence in this sample to conclude the group's true mean differs from 170.

Critical T-Values (Two-Tailed, α = 0.05)

Critical t-values by degrees of freedom
dft critical
52.571
102.228
152.131
202.086
302.042
602.000
1201.980

Where This Matters

  • Clinical trials — comparing a treatment group's outcomes against a control group or a benchmark value.
  • A/B testing — testing whether a metric genuinely differs between two variants.
  • Before/after studies — the paired t-test is the standard tool for measuring change within the same subjects over time.
  • Manufacturing — testing whether a process's average output has shifted from a target specification.

How to Use This Calculator

  1. Choose One-Sample, Two-Sample (Welch's), or Paired from the dropdown.
  2. For one-sample: enter your values and the hypothesized mean.
  3. For two-sample or paired: enter both groups' comma-separated values.
  4. Select Calculate to get the t-statistic, degrees of freedom, and two-tailed p-value.

Related Calculations

To compare more than two group means at once, use the ANOVA Calculator. To check whether the two groups' variability is comparable first, see the F-Test Calculator.