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:
Where:
x̄is the sample mean.μ₀is the population mean stated in the null hypothesis.sis the sample standard deviation, which must be greater than zero.nis 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
-
A sample above the target. A sample of
n = 25has meanx̄ = 130against a population mean ofμ₀ = 120, with sample standard deviations = 15. The sample mean is about 3.33 standard errors above the hypothesised mean. -
A small positive shift. With
x̄ = 10.5,μ₀ = 10,s = 2, andn = 16: The sample mean is exactly one standard error above the target. -
A sample below the target. With
x̄ = 98,μ₀ = 100,s = 5, andn = 25: 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 − 1degrees 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.