🧮
🧮 Math & statistics

One-Sample t-Test Calculator

Results update as you type.

Your numbers

Understanding the one-sample t-test — concept and principle

A one-sample t-test checks whether the mean of a sample differs from a fixed reference value μ₀, such as a target fill weight, a historical average or a claimed specification. It is used when the population standard deviation is unknown and has to be estimated from the same data, which is the usual situation.

One-sample t-test of ten values against 15The sample mean 16.7 is 1.7 above 15. With a standard error of 1.383, that is t = 1.23 standard errors; with 9 degrees of freedom p = 0.25, so H₀ is not rejected.Is the mean really above 15?101214161820222426μ₀ = 15x̄ = 16.7gap 1.7 measured in SE blocks (4.373 ÷ √10 = 1.383)1.71 SEt = 1.23df = 9, two-tailedp = 0.25compare with α0.25 > 0.05Fail to reject H₀a 1.7 gap is within normal noise
The 1.7 gap is only 1.23 standard errors wide (p = 0.25), too small to rule out chance.

How it is calculated

  1. Compute the sample mean x̄ and the sample standard deviation s (with divisor n − 1).
  2. Standard error: SE = s ÷ √n.
  3. Test statistic: t = (x̄ − μ₀) ÷ SE.
  4. Degrees of freedom: df = n − 1.
  5. Two-tailed p-value = 2 × P(T > |t|) for Student's t distribution with df degrees of freedom.
  6. Decision at α = 0.05: reject H₀ (the true mean equals μ₀) if p < 0.05.

The principle

If the true mean really is μ₀, the sample mean will still wander around it by about one standard error. The t statistic counts how many standard errors the observed mean lies from μ₀. Because s is itself estimated, t follows Student's t distribution rather than the normal; its heavier tails demand stronger evidence when n is small. The p-value is the probability of seeing a t at least this extreme if H₀ were true.

Worked example

  1. Data: 12, 15, 11, 19, 22, 15, 18, 25, 14, 16 (n = 10); μ₀ = 15.
  2. x̄ = 167 ÷ 10 = 16.7; s = 4.372896.
  3. SE = 4.372896 ÷ √10 = 1.382831.
  4. t = (16.7 − 15) ÷ 1.382831 = 1.229361876, with df = 9.
  5. Two-tailed p = 0.250106155.
  6. Since 0.25 > 0.05, the decision is fail to reject H₀.
How t changes with Hypothesised mean μ₀How t changes with Hypothesised mean μ₀-10-505103.757.511.21518.822.530Example: 1.229361876Hypothesised mean μ₀
Each point is the calculator re-run with only “Hypothesised mean μ₀” changed; the gold point is the default example. Change the inputs above and this chart follows your numbers.
Hypothesised mean μ₀t
3.759.364844878
7.56.65301721
11.23.941189543
151.229361876
18.8-1.482465791
22.5-4.194293459
30-9.617948793

How to read the result

Where does your result fall?Not significant0.05SignificantNot significantYour result: 0.250106 · Not significantReference: Conventional α = 0.05 significance level
Where does your result fall?

The sample mean is 1.7 above 15, but that gap is only about 1.23 standard errors; for 9 df, |t| would need to exceed 2.262 to be significant at the 5% level. A p of 0.25 means a difference this large would arise by chance about one time in four even if the true mean were 15. "Fail to reject" does not prove the mean is 15; it only says the data are not strong enough to rule it out. Report the mean difference and a confidence interval alongside p.

Common mistakes

Keep in mind: The test assumes independent observations from a roughly normal population; with small n, outliers can dominate. A p-value says nothing about practical importance.

Frequently asked questions

When should I use a z-test instead?

Only when the population standard deviation σ is known in advance, which is rare outside textbook problems.

How do I get a one-tailed p-value?

If the effect is in the predicted direction, halve the two-tailed p (here 0.125), but decide on one-tailed testing before looking at the data.

What if my data are not normal?

For moderate to large n the t-test is fairly robust. For small, skewed samples consider the Wilcoxon signed-rank test.

Sources: Student (1908). The probable error of a mean. Biometrika, 6(1), 1–25. · NIST/SEMATECH e-Handbook of Statistical Methods.

Checked 8 Nov 2026. Standard formulas, computed in your browser with double-precision numbers.

🧮 All math & statistics tools →🌍 Calculators by country →