The t-test is the standard way to compare a mean with a target when the population standard deviation is unknown.
How to use the One-Sample t-Test Calculator
- Sample mean
- Hypothesised mean (μ₀)
- Sample standard deviation
- Sample size
Results update as you type, and every field accepts the units shown in its menu.
How it works
Divide the difference between the sample mean and the hypothesised mean by the standard error, then use the t distribution.
Inputs explained
| Field | What to enter |
|---|---|
| Sample mean | A number |
| Hypothesised mean (μ₀) | A number |
| Sample standard deviation | A number |
| Sample size | A number |
What each result means
- t statistic = ([Sample mean] – [Hypothesised mean (μ₀)])÷([Sample standard deviation]÷sqrt([Sample size]))
- Degrees of freedom = [Sample size] – 1
- Two-tailed p-value = 2×(1 – tcdf(abs([t statistic]), [Degrees of freedom]))
Example values
How the main result changes when Sample mean changes and everything else stays at the example values above:
| Sample mean | Two-tailed p-value |
|---|---|
| 26.15 | 0 |
| 39.22 | 1.3893e-10 |
| 52.3 | 0.0479 |
| 65.38 | 2.7978e-14 |
| 78.45 | 0 |
| 104.6 | 0 |
Formula
t = (x̄ − μ₀) ÷ (s ÷ √n)df = n − 1Worked example
Inputs — Sample mean: 52.3; Hypothesised mean (μ₀): 50; Sample standard deviation: 6.1; Sample size: 30.
Results — t statistic = 2.0652; Degrees of freedom = 29; Two-tailed p-value = 0.04795.
Frequently asked questions
Does a small p-value prove my hypothesis?
No; it means the data would be unlikely if the null hypothesis were true.
What are the assumptions?
Independent observations and roughly normal data, especially for small samples.
What formula does the One-Sample t-Test Calculator use?
t = (x̄ − μ₀) ÷ (s ÷ √n).