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 x̄ 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 μ₀.