One-Sample T-Test Calculator

Test a sample mean against a hypothesized value

How it is calculated

You enter the sample mean x̄, the value to test against μ, the sample standard deviation s and the sample size n. The standard error is SE = s ÷ √n, the statistic is t = (x̄ − μ) ÷ SE, and the degrees of freedom are df = n − 1. Both are shown to the displayed precision (t to two decimals, df as a whole number). The sign of t tells the direction: positive when the sample mean is above μ, negative when below. The tool stops at t and df and does not give a p-value or critical value, so you read those from a t-table or software using the same df. The standard deviation must be above zero, n must be at least 2, and a fractional n is cut down to a whole number.

Worked example

A sample of 25 items has a mean of 52.3 and a standard deviation of 6.4, and you want to test it against a claimed value of 50. The standard error is 6.4 ÷ √25 = 6.4 ÷ 5 = 1.28. The difference between the means is 52.3 − 50 = 2.3, so t = 2.3 ÷ 1.28 = 1.797, shown as 1.80. The degrees of freedom are 25 − 1 = 24. You would then look up t = 1.80 against the 24-df row of a t-table to judge significance.

Try this example →

Common mistakes

  • Entering the population standard deviation or the standard error in the sd field. It expects the sample standard deviation s calculated with n − 1 in the denominator; entering the standard error divides by √n twice.
  • Reading t as a probability. It is a test statistic; the p-value must be found separately using the df shown.
  • Using the tool when the observations are paired or come from two groups. This is a one-sample test against a single fixed value; two groups need a two-sample or paired test.
  • Entering a percentage as 0.5 in one field and 50 in another. The mean and the test value must be in the same unit.
  • Treating a large t from a very small sample as conclusive. With a tiny n the critical value is much larger, so compare against the right df.

About this calculator

This calculator computes the one-sample t-statistic, t = (x̄ − μ) / (s / √n), which measures how many standard errors your sample mean x̄ sits away from a hypothesized population value μ, using the sample standard deviation s and sample size n. It returns the t value and the degrees of freedom (n − 1) but not a p-value: to judge significance, compare t against a t-distribution table or critical value for n − 1 degrees of freedom, since with small samples the t-distribution's fatter tails account for the extra uncertainty of estimating the standard deviation from the data itself.

Researchers use it whenever they want to check a sample against a known or claimed benchmark — a factory testing whether a batch's average weight matches its printed specification, or a researcher checking whether a class's test scores differ from a national average — without needing a second comparison group.

Was this helpful?

You can pick up to 3 reactions.

Comments

  • Be the first to comment.

Popular calculators

All Calculators