ProMathTools
ProMathTools

T-Test Calculator – One-Sample, Two-Sample & Paired

Run a one-sample, two-sample (Welch or pooled), or paired t-test. Get t, degrees of freedom, p-value, critical t, and a plain-English conclusion.

e.g. 5.1, 4.9, 5.3, 5.5, 5.0

Default 0.05 (must be between 0 and 1)

How the t-test works

A Student’s t-test asks whether a sample mean (or a difference of means) is far enough from a hypothesized value that the difference is unlikely under H₀. Unlike a z-test, the t-test uses the sample standard deviation and a t distribution with degrees of freedom that depend on sample size. This calculator covers three classic designs: one-sample (compare x̄ to μ₀), independent two-sample (Welch by default, optional pooled variance), and paired (matched before/after differences). For every run you get the t statistic, degrees of freedom, p-value, critical t at your α, a reject / fail-to-reject decision, and a one-sentence conclusion in plain English.

Required Inputs & Typical Use Cases

Use one-sample mode for quality-control checks against a target mean, lab calibration problems, or textbook “is μ equal to 5?” exercises. Use two-sample mode to compare two independent groups (treatment vs control, men vs women, batch A vs batch B). Prefer Welch unless you have a strong reason to assume equal variances; turn on “Pooled variance” only for the classic Student’s t with df = n₁ + n₂ − 2. Use paired mode for before/after measurements on the same subjects, twin studies, or any matched design where independence between the two lists would be wrong.


The Formula

One-sample: t = (x̄ − μ₀) / (s/√n),  df = n − 1
Welch two-sample: t = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂),  df = Welch–Satterthwaite
Pooled two-sample: t = (x̄₁ − x̄₂) / (sₚ√(1/n₁ + 1/n₂)),  df = n₁ + n₂ − 2
Paired: t = (d̄ − μ₀) / (s_d/√n) on differences dᵢ,  df = n − 1
Critical t: two-sided → tInv(1 − α/2, df); left → tInv(α, df); right → tInv(1 − α, df)
  • x̄, s, n

    Sample mean, sample SD, and sample size

  • μ₀

    Hypothesized mean (or mean difference for paired)

  • t

    Test statistic under the Student-t null distribution

  • df

    Degrees of freedom (integer or Welch–Satterthwaite)

  • α

    Significance level (default 0.05)

  • p-value

    Probability of a result at least as extreme as observed under H₀


Worked Example

  1. One-sample, two-tailed, α = 0.05

    Data 5.1, 4.9, 5.3, 5.5, 5.0 with μ₀ = 5. Then x̄ = 5.16, s ≈ 0.2408, n = 5, df = 4, SE ≈ 0.1077, t ≈ 1.4856, and two-sided p ≈ 0.2116. Because p ≥ 0.05, fail to reject H₀ — there is not significant evidence that the mean differs from 5. For reference, tInv(0.975, 10) ≈ 2.228139 (two-sided 5% critical value at df = 10).

  2. Choosing Welch vs pooled

    If the two samples have clearly different spreads, keep Welch (default). If a syllabus or paper assumes equal variances, enable pooled variance so df = n₁ + n₂ − 2 and SE uses the pooled SD sₚ.


Tips, Assumptions & Limitations

  • Paste raw lists with commas, spaces, tabs, or semicolons — or enter summary stats x̄, s, n.
  • Two-tailed is the default; switch to left or right when your alternative is directional.
  • Welch is safer for independent samples; pooled only when equal variances are justified.
  • Paired lists must be the same length; or paste the differences directly with μ₀ = 0 by default.
  • Common mistake: using a two-sample test on matched pairs (use paired instead).
  • Common mistake: treating a large |t| as significant without checking the p-value against α.
  • Never report NaN: if inputs are incomplete the calculator shows a clear error instead.

Use a one-sample t-test when you have one sample mean and want to test whether the population mean equals a hypothesized value μ₀. You need either raw data (n ≥ 2) or summary stats x̄, s, and n, with s > 0.

Welch’s t-test (the default) does not assume equal population variances and uses Welch–Satterthwaite degrees of freedom. The pooled (Student’s) t-test assumes equal variances, pools s₁² and s₂² into a single sₚ, and uses df = n₁ + n₂ − 2. Prefer Welch unless equal variances are justified.

A paired t-test is a one-sample t-test on the differences of matched pairs (before/after, twin A/twin B, etc.). Enter before and after lists of equal length, or paste the differences directly. The default hypothesized mean difference is μ₀ = 0.

Two-tailed tests H₀: mean = μ₀ (or μ₁ = μ₂). Left-tailed tests Hₐ: mean < μ₀; right-tailed tests Hₐ: mean > μ₀. α is the significance level (default 0.05). Reject H₀ when the p-value is less than α.

Critical t comes from the inverse Student-t CDF. For a two-sided test at α = 0.05 with df = 10, tInv(0.975, 10) ≈ 2.228139. For one-sided tests the calculator uses tInv(α, df) or tInv(1 − α, df) as appropriate.

Yes. One-sample and two-sample modes accept x̄, s, and n (or two sets of those). Paired mode accepts either before/after lists or a single list of differences. Commas, spaces, tabs, and semicolons are all accepted as separators.

Related Calculators

Confidence IntervalZ-Score CalculatorStandard DeviationSample Size CalculatorCorrelation CoefficientLinear RegressionCovariance CalculatorMeanMedian ModeVarianceNormal Distribution
About UsBlogChrome ExtensionFAQsTerms and ConditionsPrivacy PolicySitemap
EmailLinkedInFacebook

© 2025-2026 PromathTools. All rights reserved.

Built by KruskalCode – SaaS & Automation Experts · EverydayDevTools