T-Statistic Calculator
A sample mean of 105 against a population mean of 100, with a standard deviation of 15 and 25 observations, gives a t statistic of 1.6667. This t-statistic calculator computes the one-sample t score, the value you use to test whether a sample mean differs from a known or hypothesized population mean. Enter your sample mean, the population mean you are testing against, the sample standard deviation, and the sample size. The tool returns the t statistic to four decimal places, along with the degrees of freedom and the standard error of the mean, so you have every number you need to look up a critical value or a p-value in the next step. The t statistic measures how many standard errors your sample mean sits away from the population mean. A larger absolute value points to a bigger gap relative to the noise in your data, which is the core evidence a one-sample t test weighs before you decide whether to reject the null hypothesis.
Quick answer
The one-sample t statistic equals the mean difference divided by the standard error, or (sample mean minus population mean) divided by (sample standard deviation over the square root of n).
What this tells you
- •The one-sample t statistic equals the mean difference divided by the standard error, or (sample mean minus population mean) divided by (sample standard deviation over the square root of n).
- •The standard error of the mean is the sample standard deviation divided by the square root of the sample size, and it shrinks as your sample grows.
- •Degrees of freedom for a one-sample test equals n minus 1, and you need this number to find the matching critical value or p-value.
- •A positive t score means the sample mean sits above the population mean, and a negative t score means it sits below.
- •The t statistic is a standardized distance, so a value near 0 signals the sample mean is close to the population mean while a value far from 0 signals a wider gap.
- •This tool reports the t score only. Turning that score into a p-value is a separate step that also depends on degrees of freedom and whether your test is one-tailed or two-tailed.
How to Use
- 11. Enter your sample mean, the average of the values you actually measured, in the Sample Mean field.
- 22. Enter the population mean you are testing against in the Population Mean field. This is your null-hypothesis value, often a known standard or a claimed average.
- 33. Enter the sample standard deviation in the Sample SD field. Use the sample standard deviation, which divides by n minus 1, not the population standard deviation.
- 44. Enter the sample size, the count of observations in your sample, as a whole number of at least 2.
- 55. Read the t statistic as your primary result, then note the degrees of freedom and standard error below it so you can look up the matching critical value or p-value.
How It Works
Formula
t = (x̄ - μ) / (s / √n)The one-sample t statistic takes the difference between the sample mean (x-bar) and the population mean (mu), then divides by the standard error of the mean. The standard error is the sample standard deviation (s) divided by the square root of the sample size (n). The result expresses the gap between the two means in units of standard error, which is why it is called a standardized test statistic. Degrees of freedom equals n minus 1. The formula assumes the sample standard deviation is greater than zero and the sample size is a whole number of at least 2, since a single observation has no spread to estimate. The tool rounds the t statistic and standard error to four decimal places for display while keeping full precision internally.
Calculation note: values are processed in the order shown above, using the current input units.
Worked Examples
Sample mean above the population mean
The standard error is 15 divided by the square root of 25, which is 15 over 5, or 3. The mean difference is 105 minus 100, which is 5. Dividing 5 by 3 gives a t statistic of 1.6667. With 25 observations, the degrees of freedom is 24.
Sample mean below the population mean
The standard error is 4 divided by the square root of 16, which is 4 over 4, or 1. The mean difference is 48 minus 50, which is negative 2. Dividing negative 2 by 1 gives a t statistic of negative 2, a value that sits two standard errors below the population mean.
Sample mean equal to the population mean
When the sample mean matches the population mean, the mean difference is 0, so the t statistic is 0 regardless of the standard error. The standard error here is 10 divided by 3, about 3.3333, and the degrees of freedom is 8. A t score of 0 gives no evidence against the null hypothesis.
Small sample at the minimum size
With just 2 observations the standard error is 2 divided by the square root of 2, about 1.4142. The mean difference is 2, so the t statistic is 2 divided by 1.4142, which is also about 1.4142. Degrees of freedom is 1, the smallest a one-sample t test allows, and results from such a tiny sample carry very wide uncertainty.
T-Statistic Quick Reference
How the same mean difference produces different t statistics as the standard error changes.
| Mean Difference | Sample SD | Sample Size | Standard Error | T Statistic |
|---|---|---|---|---|
| 5 | 15 | 25 | 3.0000 | 1.6667 |
| 5 | 10 | 25 | 2.0000 | 2.5000 |
| 5 | 10 | 100 | 1.0000 | 5.0000 |
| -2 | 4 | 16 | 1.0000 | -2.0000 |
| 0 | 10 | 9 | 3.3333 | 0.0000 |
| 3 | 6 | 36 | 1.0000 | 3.0000 |
A larger sample or a smaller standard deviation shrinks the standard error, which increases the absolute t statistic for the same mean difference.
T statistic versus p-value
The t statistic and the p-value answer related but different questions. The t statistic is a single standardized number that says how far your sample mean sits from the population mean, measured in standard errors. It comes straight from your data through the formula and does not require any probability table on its own. That is exactly what this calculator returns.
The p-value takes that t statistic one step further. It asks how likely you would be to see a t statistic this extreme, or more extreme, if the null hypothesis were true. Converting a t score to a p-value needs two more pieces of information: the degrees of freedom, which this tool provides, and whether your test is one-tailed or two-tailed. That conversion uses the Student t distribution rather than simple arithmetic.
In practice you compute the t statistic first, then decide significance either by comparing it to a critical value from a t table or by finding its p-value. If the absolute t statistic exceeds the critical value for your chosen significance level and degrees of freedom, or equivalently if the p-value falls below your alpha, you reject the null hypothesis. Keeping the two steps separate makes it easier to see where your evidence comes from and where your decision rule kicks in.
Common mistakes
- Using the population standard deviation instead of the sample standard deviation. A one-sample t test uses the sample standard deviation, which divides by n minus 1, because the population value is usually unknown.
- Confusing the t statistic with the p-value. The t statistic is a standardized distance, while the p-value is the probability tied to that distance. This tool gives you the t score, not the p-value.
- Entering a sample size below 2. A one-sample t test needs at least 2 observations, since a single value has no spread and no degrees of freedom to estimate variability.
- Forgetting that degrees of freedom is n minus 1, not n. Looking up a critical value with the wrong degrees of freedom leads to the wrong significance decision.
- Swapping the sample mean and the population mean. The sign of the t statistic flips if you reverse them, which changes whether the result reads as above or below the tested value.
Embed this calculator on your site
Drop this single line where you want the calculator to appear. It is responsive, mobile-friendly, resizes automatically, and is free to use with attribution.
<script src="https://calctide.com/embed.js" data-tool="t-statistic-calculator" async></script>Preview the embed at /embed/t-statistic-calculator/.