Calculators
Home › Calculators › One-Sample t-Test

One-Sample t-Test Calculator

One dataset, one hypothesised mean: the test, its steps and its effect size.

Run a one-sample t-test

Paste your sample, set the hypothesised mean, choose tails and α.

Quick answer: t = (x̄ − μ₀) ÷ (s ÷ √n) on n − 1 df. The bakery example: t(7) = 2.68, p = 0.0316, significant at 0.05, with a large effect (d = 0.95).

What the one-sample t-test decides

You have one sample and one claim about the population it came from: the true mean is μ₀. The one-sample t-test weighs the sample mean against that claim, in units of the standard error: how far apart they are, relative to how much a sample mean naturally wobbles. It uses the t distribution because the standard deviation is estimated from the same sample, and small samples make that estimate shaky; the fat tails are the honest price.

One-sample t statistict = (x̄ − μ₀) ÷ (s ÷ √n),   df = n − 1
Worked example

A bakery believes it sells 40 cakes a day on average; eight days of records say 42, 38, 45, 51, 44, 39, 47, 50. Sample mean 44.5, s = 4.7509, standard error 1.6797. t = (44.5 − 40) ÷ 1.6797 = 2.679 on 7 df, two-tailed p = 0.0316. At α = 0.05 the null is rejected: the bakery's true daily average is plausibly above 40. The effect is not trivial either, Cohen's d = 0.947, a large standardised difference, and the 95% interval for the mean (40.53 to 48.47) clears 40 entirely, telling the same story.

Assumptions, in plain sight

One tail or two?

Two tails is the honest default: the mean could be above or below μ₀, and both would interest you. Choose a one-tailed alternative only when the other direction is genuinely meaningless for the decision at hand, and choose it before seeing the data.

Watch out

Running the z-test instead because it is familiar. With σ estimated from n = 8, the z-test's p would read 0.0074 against the t-test's honest 0.0316, overstating the evidence more than fourfold.

Frequently asked questions

What if my data are clearly not normal?

With n above roughly 30 the central limit theorem carries the mean a long way. For small, badly skewed samples, a Wilcoxon signed-rank test (on this site's nonparametric pages) is the safer instrument: it tests medians rather than means.

What does Cohen's d add?

The p-value says whether the difference is detectable; d says how big it is in standard-deviation units. 0.2 is small, 0.5 medium, 0.8 large, by the usual rough labels.

Can I test a hypothesised median instead?

Not with this test. It is built for means. For medians, use the sign test or Wilcoxon signed-rank test.