Skip to main content

DigitalCalculators.net

T-Test Calculator

Run a one-sample, two-sample (Welch or pooled) or paired t-test from your data, with the t statistic, degrees of freedom, p-value, confidence interval and steps.

Results

ItemValue

Steps

StepWorking
Assumes roughly normal data or reasonably large samples, and independent observations. Welch’s test does not assume equal variances and is a safe default for two samples. The p-value uses the exact t distribution.

Quick Answer

A t-test compares means. For two samples, t = (mean₁ − mean₂) ÷ SE. With the example data, sample means of 13.8125 and 12.1750 give Welch's t ≈ 4.0217. If the p-value is below 0.05, the difference is called statistically significant.

Last updated: 3 November 2026 ·How we calculate this: Student's t distribution

Table of Contents

How This T-Test Calculator Works

Choose the test, then paste your numbers. For two independent groups, use Welch's test (or the pooled test if the variances are equal). For before-and-after measurements on the same subjects, use the paired test. To compare one sample with a known value, use the one-sample test. The calculator finds the means, standard deviations, standard error, t statistic, degrees of freedom, p-value and a confidence interval for the difference.

Quick explanation: the t statistic measures the difference in standard-error units.

  • Large |t|: the difference is large compared with the noise.
  • Small p-value: such a difference would be unlikely if there were no real difference.
  • Degrees of freedom: depend on sample sizes and set the shape of the t curve.

How to Use the T-Test Calculator

  1. Choose the type of t-test.
  2. Paste sample 1 and, if needed, sample 2.
  3. For a one-sample test, enter the hypothesized mean.
  4. Choose the tail and significance level.
  5. Press Calculate and read t, df, the p-value and the interval.

Core Formulas

  • One-sample: t = (x̄ − μ₀) ÷ (s ÷ √n), df = n − 1
  • Paired: t = d̄ ÷ (s_d ÷ √n), df = n − 1
  • Welch: t = (x̄₁ − x̄₂) ÷ √(s₁²/n₁ + s₂²/n₂), with the Welch–Satterthwaite df
  • Pooled: sp² = ((n₁ − 1)s₁² + (n₂ − 1)s₂²) ÷ (n₁ + n₂ − 2), df = n₁ + n₂ − 2
  • Confidence interval: difference ± t* × SE

Key Terms

  • t statistic: the difference divided by its standard error.
  • Degrees of freedom: a number based on sample size that sets the t curve's shape.
  • p-value: the chance of a result at least this extreme if the null hypothesis is true.
  • Null hypothesis: the starting assumption, usually no difference.
  • Standard error: the standard deviation of a sample mean or difference.

Worked Example

Test whether a mean of 52 from 16 scores with SD 8 differs from 48.

  • SE = 8 ÷ √16 = 2
  • t = (52 − 48) ÷ 2 = 2, with df = 15
  • The two-tailed p-value is about 0.064, so at α = 0.05 the difference is not significant

Real-Life Examples

  • A/B tests: compare average order values between two page designs.
  • Medicine: compare blood pressure before and after a treatment with a paired test.
  • Quality control: check whether parts match a target length with a one-sample test.
  • School: compare test scores between two classes.

T-Test vs Z-Test

  • T-test: used when the population standard deviation is unknown, which is most of the time.
  • Z-test: used when the population standard deviation is known.
  • Large samples: the t distribution gets very close to the normal curve.

Two-Tailed Critical t Values

Values from the t distribution.

dfα = 0.10α = 0.05α = 0.01
16.31412.70663.657
52.0152.5714.032
101.8122.2283.169
151.7532.1312.947
201.7252.0862.845
301.6972.0422.750
601.6712.0002.660
1201.6581.9802.617

Choosing the Right Test

  • Different people in each group: two-sample test (Welch by default).
  • Same people measured twice: paired test.
  • One group against a target: one-sample test.
  • Direction known in advance: a one-tailed test, decided before seeing the data.
  • Very skewed data or outliers: consider a non-parametric test such as the Mann-Whitney U test instead.

Common Mistakes to Avoid

  • Using a two-sample test on paired data. Paired data need the paired test.
  • Choosing the tail after seeing the data. Decide before you look.
  • Assuming equal variances. Welch's test is safer when unsure.
  • Treating p > 0.05 as proof of no difference. It only means the evidence is not strong enough.
  • Ignoring effect size. A tiny difference can be significant with huge samples.

Frequently Asked Questions

A test that checks whether a mean, or the difference between two means, is larger than chance would explain.

Two separate groups: Welch. Same subjects twice: paired. One group against a value: one-sample.

The chance of seeing a difference this large if there were really no difference.

A two-sample t-test that does not assume equal variances.

n − 1 for one-sample and paired tests, n₁ + n₂ − 2 for pooled, and the Welch–Satterthwaite formula for Welch.

There is no fixed minimum, but small samples need roughly normal data.

Yes, as numbers, but for proportions a z-test for proportions is often better.

A range of plausible values for the true mean difference.

By the usual rule, p must be below α to be significant.

ANOVA compares three or more groups. With two groups, it gives the same result as a pooled t-test.

Yes. Copy a column and paste it into the box.

From the exact t distribution using the incomplete beta function.

References & Sources

SourceUsed ForLink
Wikipedia, Student's t-test One-sample, paired, pooled and Welch t-tests. https://en.wikipedia.org/wiki/Student%27s_t-test
NIST/SEMATECH e-Handbook, Two-Sample t-Test for Equal Means Formulas and assumptions. https://www.itl.nist.gov/div898/handbook/eda/section3/eda353.htm