Is the difference real?

t-test calculator

A t-test divides a difference by its standard error. Two classes averaging 78.4 (SD 9.1, n 25) and 72.6 (SD 10.4, n 28) give Welch t = 2.165 with 51 degrees of freedom and p = 0.0351: significant at the 5% level.

Final Grade Calculator editorial teamUpdated 6 sources

Calculator

t-test calculator

Means, SDs and sizes, or paste the raw numbers

Which test?

Your samples

Sample 1

Sample 2

Hypothesis

t = 2.1653

Welch two-sample t-test, df = 50.98

−3−2−10123

p = 0.0351 for H₁: μ₁ − μ₂ ≠ 0. Reject H₀ at α = 0.05.

Difference
5.8
Standard error
2.6787
95% CI of the difference
0.4223 to 11.1777
Cohen's d
0.591
Critical t (two-sided)
±2.0076
Degrees of freedom
50.98

How it works. t = (difference − hypothesized value) ÷ standard error. Welch uses SE = √(s₁²/n₁ + s₂²/n₂) and the Welch–Satterthwaite df; the equal-variance test pools the two SDs and uses n₁ + n₂ − 2 df.

Which t-test should I use?

Pick the t-test from how the data were collected: one group against a known value, two separate groups, or the same subjects measured twice.[2][1]

Choosing a t-test
SituationTestStandard errordf
One sample vs a target value (μ₀)One-sample ts ÷ √nn − 1
Two independent groupsWelch t (default)√(s₁²/n₁ + s₂²/n₂)Welch–Satterthwaite
Two independent groups, equal spreads assumedPooled (Student) tsₚ √(1/n₁ + 1/n₂)n₁ + n₂ − 2
Same subjects before and after, or matched pairsPaired ts_d ÷ √npairs − 1

Welch’s test is the safer default for two groups because it does not assume equal variances; when the spreads and sizes are similar it gives almost the same answer as the pooled test.[1] For the example classes, Welch gives t = 2.1653 (df 50.98, p = 0.0351) and the pooled test t = 2.1487 (df 51, p = 0.0364).

How the t-test works

t = (difference − hypothesized difference) ÷ standard errorWelch df = (s₁²/n₁ + s₂²/n₂)² ÷ [(s₁²/n₁)²/(n₁ − 1) + (s₂²/n₂)²/(n₂ − 1)]

Worked examples

One-sample: 36 students average 105 with SD 15; is the mean different from 100? SE = 15 ÷ 6 = 2.5, t = 5 ÷ 2.5 = 2, df = 35, two-tailed p = 0.0533: not significant at 0.05, just.

Paired: 12 students improve by an average of 3.2 points (SD of the differences 4.1). t = 3.2 ÷ (4.1 ÷ √12) = 2.704, df = 11, p = 0.0205.

The p-value is the tail area of the t distribution beyond your t.[3] The p-value calculator does that step alone if you already have t and df.

Reading the result

Reject the null hypothesis when p is below your significance level α (usually 0.05).[6] The calculator adds what the p-value leaves out: a confidence interval for the difference and Cohen’s d, the difference in standard-deviation units. For the two classes, the 95% interval for the difference is 0.42 to 11.18 points and d = 0.59.[5]

Raw data or summariesChoose “The raw numbers” to paste each group’s values; the calculator computes the means, SDs and sizes for you. For a paired test, list both measurements in the same order, and it works with the differences.

Assumptions to check

  • Independence: each value comes from a different subject (or a different pair, for the paired test).
  • Roughly normal data, or a large enough sample: with fewer than about 30 per group, look for strong skew or outliers in the statistics calculator.
  • Equal variances only for the pooled test. If one SD is much larger than the other, use Welch.

Common t-test mistakes

  • Running a two-sample test on paired data. Before/after scores from the same students need the paired test, which is usually much more sensitive.
  • Choosing a one-sided test after seeing the data. Decide the direction first.
  • Reporting only “p < 0.05”. Give t, df, p, the interval and the effect size. A confidence interval for each group’s mean is a useful companion.

How we check this calculator

Tests run before every update: a one-sample case with t = 2 and df = 35 must give p = 0.0533; Welch and pooled tests must agree exactly when sizes and SDs are equal; the Welch df is checked against a hand calculation; the t distribution matches NIST critical values to 10 digits.[4]

  • 14 November 2026: page and calculator published.

More statistics calculators

Frequently asked questions

What is the difference between a paired and a two-sample t-test?

A paired test compares two measurements on the same subjects (before and after) by testing the mean of the differences. A two-sample test compares two separate groups.

Should I use Welch’s t-test or Student’s t-test?

Use Welch’s test unless you have a good reason to assume equal variances. It is accurate when the spreads differ and nearly identical to Student’s test when they do not.

How do I calculate degrees of freedom for a t-test?

n − 1 for a one-sample or paired test (n = number of pairs), n₁ + n₂ − 2 for the pooled test, and the Welch–Satterthwaite formula for Welch’s test, which usually gives a non-whole number.

What does a t value mean?

How many standard errors the observed difference is from the hypothesized one. Values beyond about ±2 are significant at 5% for moderate sample sizes.

Can I run a t-test from means and standard deviations only?

Yes. Enter each group’s mean, SD and size. The raw data are only needed if you have not computed those yet.

Sources

  1. 1.3.5.3 Two-Sample t-Test for Equal Means · NIST/SEMATECH e-Handbook of Statistical Methods, 2012 edition (DOI 10.18434/M32189)
  2. Introductory Statistics 2e, 10.1 Two Population Means with Unknown Standard Deviations · OpenStax, Rice University, 2nd edition, 2023
  3. 1.3.6.6.4 t Distribution · NIST/SEMATECH e-Handbook of Statistical Methods, 2012 edition (DOI 10.18434/M32189)
  4. 1.3.6.7.2 Critical Values of the Student’s t Distribution · NIST/SEMATECH e-Handbook of Statistical Methods, 2012 edition (DOI 10.18434/M32189)
  5. The ASA Statement on p-Values: Context, Process, and Purpose (Wasserstein and Lazar) · American Statistical Association, The American Statistician 70(2), 2016
  6. Introductory Statistics 2e, 9.2 Outcomes and the Type I and Type II Errors · OpenStax, Rice University, 2nd edition, 2023