This t-test calculator runs one-sample and independent two-sample (Welch) t-tests from summary statistics — means, standard deviations, sample sizes — returning t, degrees of freedom and the exact p-value.

t Statistic–
Degrees of Freedom–
p (two-tailed)–
p (one-tailed)–

Report both the p-value and the effect (our Cohen’s d Calculator): a significant t with a trivial mean difference is a large-n artifact, not a discovery. Paired data (same subjects twice) needs the paired t-test on differences — run it here as a one-sample test on the difference scores against µ₀ = 0.

t = (x̄ − µ₀) ÷ (s ÷ √n) — Signal in Units of Noise

The t-statistic counts how many standard errors separate the sample mean from the hypothesized value; the t-distribution (heavier-tailed than the normal, by degrees of freedom) prices how surprising that is. Welch's two-sample variant — the default here, as modern practice prefers — refuses to assume equal variances and pays for the honesty with fractional df. P-values in depth: our P-Value Calculator. Part of our Statistics Calculators collection.

Worked Examples (Verified)

  • One-sample defaults: x̄=52, s=10, n=25 vs µ₀=50 → t = 2/(10/5) = 1.000, df 24, two-tailed p ≈ 0.3273 — a full standard error of separation, and still nowhere near significance at n=25: the t-test's humility lesson
  • Calibration check of the engine: t = 2.000 at df 10 gives two-tailed p = 0.0734 (table value) — the incomplete-beta machinery reproduces published tables
  • Two-sample sketch: means 52 vs 50 with the defaults' SDs/sizes → t ≈ 0.66, Welch df ≈ 53 — a 2-point gap swamped by spread at these sample sizes
  • The paired trick: before/after differences averaging 1.8 with s=3.5, n=20, tested against 0 as a one-sample test → t = 2.30, df 19, p ≈ 0.033 — significance the unpaired analysis would have missed entirely

Assumptions, Stated Plainly

  • Data approximately normal (or n large enough for CLT grace — the t-test is robust to mild violations, allergic to severe skew at tiny n).
  • Observations independent — the assumption no formula rescues when violated (clustered or repeated data need their own methods).
  • Two-sample here = independent groups. Same subjects measured twice = paired analysis (differences as one-sample), not this page's two-sample mode.
  • One-tailed p is offered because pre-registered directional hypotheses exist — choosing it after seeing the data is p-hacking, and the calculator cannot absolve that.

Related Tools

Frequently Asked Questions

How do you calculate a t-test by hand?

One-sample: t = (x̄ − µ₀) ÷ (s/√n) with df = n − 1. Then compare t against the t-distribution for that df to get p. Sample mean 52, s 10, n 25, µ₀ 50: standard error 2, t = 1.00, p ≈ 0.33 — not significant. This calculator performs the table lookup (via the incomplete beta function) exactly.

What's the difference between one-sample, two-sample and paired t-tests?

One-sample compares one mean to a known value. Two-sample compares two independent groups' means. Paired compares the mean of within-subject differences to zero — mathematically a one-sample test on the differences, which you can run here by entering the difference scores' mean and SD in one-sample mode.

Why does this use Welch's test for two samples?

Welch's t-test doesn't assume equal population variances, and simulation evidence favors it as the default: it controls error rates better when variances or group sizes differ, at negligible cost when they're equal. Its degrees of freedom (Welch–Satterthwaite) are fractional — that's expected, not a bug.

What p-value is "significant"?

Convention says 0.05, a historical accident calcified into gatekeeping. Report the exact p (this calculator gives four decimals), the effect size, and the confidence interval — the trio conveys what the binary verdict hides. Our Confidence Interval Calculator supplies the interval for means.

My p is 0.049 vs 0.051 — does it matter?

Scientifically, barely — the evidence is essentially identical; the cliff is in publishing customs, not in nature. Treat both as "borderline, replicate with more data." If a decision truly hinges on the boundary, the honest move is a larger sample, not a different test.

Is this t-test calculator free?

Yes — free, instant, no sign-up.