InfyCalculator
📊

One-Sample T-Test Calculator

Test a sample mean against a hypothesised value using the sample standard deviation, with the t statistic, degrees of freedom and a decision.

Sample mean (x̄)
Hypothesised mean (μ₀)
Sample std dev (s)
Sample size (n)
Alternative hypothesis
Loading calculator…

How it works

t = (x̄ − μ₀) ÷ (s ÷ √n) · df = n − 1

The one-sample t-test compares a sample mean to a hypothesised value when the population standard deviation is unknown and must be estimated from the sample. Because that estimate adds uncertainty, the test uses Student’s t distribution, whose heavier tails widen as the sample shrinks (df = n − 1). The result is a fairer p-value for small samples than a z-test would give.

Worked example

A sample of 25 items averages 52 with a sample standard deviation of 5, tested against μ₀ = 50. The standard error is 5 ÷ √25 = 1, so t = (52 − 50) ÷ 1 = 2.0 on 24 degrees of freedom. The two-sided p-value is about 0.057 — just above 0.05, so we narrowly fail to reject.

Sources: Student’s t-test — Wikipedia

Frequently asked questions

Why does the t-test use degrees of freedom?

Estimating the standard deviation from the sample uses up one piece of information, leaving n − 1 free to vary. The t distribution accounts for that by spreading its tails wider at low df, then converging on the normal curve as the sample grows.

What assumptions does this test make?

It assumes the observations are independent and the underlying population is roughly normal, or that the sample is large enough for the mean to be approximately normal. With strong skew and a small sample, a non-parametric test may be safer.

How is this different from a z-test?

A z-test uses a known population σ and the normal distribution; the t-test uses the sample’s own s and the wider t distribution. For large samples the two give nearly identical answers.

Related calculators

For education — check the assumptions (sample size, independence, distribution) before using these statistics in real decisions.