StatGardenREF. DESK
Calculators/Statistics/T-statistic (one or two sample)
Statistics

T-statistic (one or two sample) calculator

How many standard errors a sample mean is from the reference value, or from another mean.

Published 6 August 2026 · Updated 25 September 2026

What this calculator does

The t-statistic measures how many standard errors a sample mean sits from a reference value. A sample of 25 with a mean of 52 and standard deviation of 8, tested against 50, gives t = 1.250 on 24 degrees of freedom.

It is the workhorse of mean comparison precisely because it does not require the population standard deviation. Using the sample estimate instead adds uncertainty, and the t-distribution accounts for that with heavier tails than the normal. The penalty is severe for small samples and negligible above about 30 observations.

The formula

FormulaOne-sample: t = (x̄−μ)/(s/√n); Two-sample (pooled, equal variance): t = (x̄₁−x̄₂)/(sp√(1/n₁+1/n₂))

The one-sample statistic is the difference between the sample mean and the reference, divided by the standard error s/√n, with n−1 degrees of freedom. The two-sample version uses the pooled standard deviation and gives n₁+n₂−2 degrees of freedom. The statistic alone is not a conclusion: it must be compared with a critical value or converted to a p-value.

TermMeaning
t-statisticThe difference expressed in standard errors.
Degrees of freedomn−1 for one sample, n₁+n₂−2 for two pooled samples.
Standard errors/√n, using the sample standard deviation.
Critical valueThe threshold from a t-table for your degrees of freedom and significance level.

The inputs explained

FieldWhat to enter
Test typeOne sample tests against a fixed reference; two samples compare two groups.
Sample 1 meanSample 1 mean.
Sample 1 standard deviationSample 1 standard deviation.
Sample 1 sizeSample 1 size.
Reference mean (μ), one-sample onlyReference mean, used in one-sample mode only.
Sample 2 mean, two-sample onlySample 2 mean, two-sample mode only.
Sample 2 standard deviation, two-sample onlySample 2 standard deviation, two-sample mode only.
Sample 2 size, two-sample onlySample 2 size, two-sample mode only.

When to use it

Testing against a target

Whether a measured average differs from a specification, a historical figure or a claim.

Comparing two groups

The standard comparison of treatment against control when the outcome is a continuous measure.

Reading a published result

Papers report t and degrees of freedom, and reconstructing them checks the arithmetic.

Worked examples

Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.

What does each sample mean give?

A range of sample means against the same reference.

One sample, μ = 50, s = 8, n = 25
Sample meant-statisticDegrees of freedomStandard error
500241.600
521.250241.600
542.500241.600
563.750241.600
The standard error stays at 1.600, so every 1.6 points of difference adds 1 to the statistic. With 24 degrees of freedom the two-tailed 5% critical value is about 2.064, so the 54 row at t = 2.500 clears it and the 52 row at 1.250 does not.

Questions

When do I use t instead of z?

Whenever the population standard deviation is unknown and estimated from the sample, which is almost always. The z-test requires a genuinely known sigma. For samples above about 30 the two give nearly identical answers, but t remains the correct choice.

What is a large t-statistic?

It depends on the degrees of freedom. At df = 24 the two-tailed 5% threshold is about 2.064; at df = 5 it is 2.571; at df = 1000 it is 1.962. There is no universal cutoff, which is why the critical value must be looked up rather than assumed.

Should I use the pooled or Welch version?

Welch unless you have good reason to believe the variances are equal. It costs almost nothing in power when they are equal and protects you when they are not. Many statisticians now recommend Welch as the default for two-sample comparisons.

Does a large t mean a large effect?

No. The t-statistic grows with sample size for a fixed difference, so a large t can reflect a large sample rather than a meaningful effect. Report an effect size such as Cohen d alongside it to describe the magnitude.

For the effect size, see the Cohen’s d calculator. For the threshold to compare against, see the critical value calculator.