Statistics

T-statistic calculator

Settings
Reset
Share
Save
Embed
Report a bug

Share calculator

Add our free calculator to your website

Source

Please enter a valid URL. Only HTTPS URLs are supported.

Styling

Input border focus color, switchbox checked color, select item hover color etc.

Advanced

Please agree to the Terms of Use.

Preview

Save calculator

Calculator Settings

Please enter a value within the allowed range.

Please enter a value within the allowed range.

Please enter a value within the allowed range.

Please enter a value within the allowed range.

Share calculator

What is a t-statistic?

A t-statistic measures how far a sample mean sits from a hypothesised population mean, scaled by the sample’s own variability. It is the centrepiece of the one-sample t-test: you collect a sample, compare its average against a target value, and the t-statistic tells you how surprising that gap is in standard-error units. A t-statistic near 0 means the sample mean is close to the population mean; a large positive or negative value means the sample sits far from it.

The t-statistic is closely related to the z-score, but it uses the sample standard deviation instead of a known population standard deviation. That substitution is exactly why the t-distribution exists: it has slightly heavier tails than the normal distribution to account for the extra uncertainty in estimating spread from a small sample.

How does the calculator work?

Enter the sample mean, the population mean you are testing against, the sample standard deviation, and the sample size. The calculator returns the one-sample t-statistic:

t=xˉμ0s/nt = \frac{\bar{x} - \mu_0}{s / \sqrt{n}}

Where:

  • is the sample mean.
  • μ₀ is the population mean stated in the null hypothesis.
  • s is the sample standard deviation, which must be greater than zero.
  • n is the sample size, which must be at least one.

The denominator s / √n is the standard error of the mean — the typical distance between a sample mean and the true mean. Dividing the raw difference by the standard error converts it into a unitless test statistic you can compare against a t-distribution with n − 1 degrees of freedom.

Worked examples

  1. A sample above the target. A sample of n = 25 has mean x̄ = 130 against a population mean of μ₀ = 120, with sample standard deviation s = 15. t=13012015/25=1033.3333t = \frac{130 - 120}{15 / \sqrt{25}} = \frac{10}{3} \approx 3.3333 The sample mean is about 3.33 standard errors above the hypothesised mean.

  2. A small positive shift. With x̄ = 10.5, μ₀ = 10, s = 2, and n = 16: t=10.5102/16=0.50.5=1t = \frac{10.5 - 10}{2 / \sqrt{16}} = \frac{0.5}{0.5} = 1 The sample mean is exactly one standard error above the target.

  3. A sample below the target. With x̄ = 98, μ₀ = 100, s = 5, and n = 25: t=981005/25=21=2t = \frac{98 - 100}{5 / \sqrt{25}} = \frac{-2}{1} = -2 The negative sign shows the sample mean falls two standard errors below the hypothesised mean.

Practical notes

  • The sample standard deviation must be positive. A value of zero would mean the data has no spread, making the standard error — and the t-statistic — undefined.
  • To judge significance, compare the t-statistic against a critical value from the t-distribution with n − 1 degrees of freedom, or convert it to a p-value.
  • For large samples the t-distribution converges to the normal distribution, so the t-statistic and the z-score become almost identical.
  • Use this one-sample formula when comparing a single sample mean to a fixed reference value; a two-sample test uses a different denominator.

FAQ

Can a t-statistic be negative?

Yes. A negative t-statistic simply means the sample mean is below the population mean you are testing against. The sign indicates direction, while the magnitude indicates distance in standard-error units.

What is the difference between a t-statistic and a z-score?

Both measure distance from a reference value, but the z-score divides by a known population standard deviation, while the t-statistic divides by the standard error built from the sample standard deviation. The t-statistic is the right choice when the population standard deviation is unknown. See the z-score calculator for the population-standard-deviation case.

What are degrees of freedom?

For a one-sample t-test the degrees of freedom equal n − 1. They describe the shape of the t-distribution you compare the statistic against: fewer degrees of freedom give heavier tails and a more conservative test.

Why must the sample standard deviation be greater than zero?

The formula divides by the standard error s / √n. If s were zero the division would be undefined, and a sample with no variability cannot support a meaningful test.

Report a bug

This field is required.