t-Statistic Calculator

Compute the one-sample t-statistic t = (x̄ − μ₀) / (s / √n) from your sample mean, sample standard deviation, sample size, and hypothesized mean, with degrees of freedom and standard error.

Quick Facts

Formula
t = (x̄ − μ₀) / (s / √n)
One-sample t-test; degrees of freedom = n − 1. The denominator s / √n is the standard error of the mean.

Your Results

Calculated
t-statistic
-
(x̄ − μ₀) / (s / √n)
Standard error
-
s / √n
Degrees of freedom
-
n − 1
Mean difference
-
x̄ − μ₀

Ready

Enter your sample statistics and hypothesized mean, then calculate.

The one-sample t-statistic formula

This calculator computes the one-sample t-statistic, the test statistic used to decide whether a sample mean differs from a hypothesized population mean. The formula is:

t = (x̄ − μ₀) / (s / √n)

where is the sample mean, μ₀ is the hypothesized population mean (the value under the null hypothesis), s is the sample standard deviation, and n is the sample size. The denominator s / √n is the standard error of the mean — an estimate of how much the sample mean would vary from sample to sample. The test has n − 1 degrees of freedom.

In plain terms, the t-statistic measures how many standard errors your sample mean sits away from the value you are testing against. A t near 0 means the sample mean is close to μ₀; a large positive or negative t means the sample mean is far away relative to the noise in the data.

Why you use t instead of z

When the population standard deviation σ is known, you would use a z-statistic with the standard normal distribution. In practice σ is almost never known, so you estimate it with the sample standard deviation s. That extra estimation adds uncertainty, especially with small samples, which is exactly why William Sealy Gosset ("Student") introduced the t-distribution in 1908. The t-distribution has heavier tails than the normal distribution; as the sample size grows, the two converge — by about n = 30 they are nearly identical, and in the limit the t-distribution becomes the standard normal.

A worked example

Suppose a machine is supposed to fill bottles to 100 ml (μ₀ = 100). You sample 25 bottles and find a mean of x̄ = 102 ml with a sample standard deviation of s = 8 ml. The standard error is 8 / √25 = 8 / 5 = 1.6. The t-statistic is (102 − 100) / 1.6 = 2 / 1.6 = 1.25, with 25 − 1 = 24 degrees of freedom. The two-sided critical value at α = 0.05 for 24 df is about 2.064, so |t| = 1.25 does not reach significance: the sample gives no strong evidence that the true fill differs from 100 ml.

Interpreting the result

Once you have t, you compare it to a critical value from the t-distribution for your degrees of freedom and significance level, or you convert it to a p-value. Common two-sided critical values at α = 0.05 are approximately 2.776 for df = 4, 2.228 for df = 10, 2.064 for df = 24, 2.042 for df = 30, and 1.984 for df = 100; as df → ∞ the critical value approaches 1.960. If |t| exceeds the critical value, you reject the null hypothesis that the population mean equals μ₀.

Frequently Asked Questions

What is the formula for the one-sample t-statistic?
t = (x̄ − μ₀) / (s / √n), where x̄ is the sample mean, μ₀ is the hypothesized population mean, s is the sample standard deviation, and n is the sample size. The denominator s / √n is the standard error of the mean, and the test uses n − 1 degrees of freedom.
What is the difference between a t-statistic and a t-test?
The t-statistic is the single number computed by the formula above. The t-test is the full procedure: you compute the t-statistic, then compare it against the t-distribution (using n − 1 degrees of freedom) to obtain a p-value or a reject/fail-to-reject decision at your chosen significance level.
Can the t-statistic be negative?
Yes. The sign follows x̄ − μ₀: a negative t means the sample mean is below the hypothesized mean, a positive t means it is above. For a two-sided test only the magnitude |t| matters; for a one-sided test the sign tells you which tail to use.
What assumptions does this test rely on?
The one-sample t-test assumes the observations are independent, sampled randomly, and that the underlying population (or, for larger n, the sampling distribution of the mean) is approximately normal. It is fairly robust to mild non-normality once n is moderate, but heavy skew or strong outliers in a small sample can distort the result.