Home / T-Test Calculator

T-Test Calculator

A one-sample t-test: how far your sample's average sits, in standard errors, from a number you're testing it against.

Set up the calculation

What you get

t-statistic--
Degrees of freedom--
Standard error--

Recalculated live from the four fields to the left; only your browser sees them.

Worked example

The one-sample t-test determines whether a sample mean is significantly different from a known or hypothesized population mean. It is appropriate when the population standard deviation is unknown and you are estimating it from the sample instead.

Formulas: standard error (SE) = s / sqrt(n). t = (sample mean - population mean) / SE. Degrees of freedom = n - 1.

For the defaults (x-bar = 52, mu = 50, s = 5, n = 30): SE = 5 / sqrt(30) = 0.9129; t = (52 - 50) / 0.9129 = 2.191; df = 29. With 29 degrees of freedom, a t of 2.191 exceeds the critical value of 2.045 at alpha = 0.05 two-tailed, so the result would be statistically significant at that threshold.

Reference: two-tailed critical values (alpha = 0.05)

These are the standard published Student's t critical values, not something this calculator looks up on its own; use them to judge your own t-statistic by eye before running it through the p-value calculator for an exact figure:

Degrees of freedomCritical t
52.571
102.228
202.086
302.042
602.000
1201.980

Notice the critical value creeps down toward 1.96 as degrees of freedom grow: with enough data the t-distribution converges on the normal curve, which is why the z-score calculator's 1.96 threshold and this table's tail end line up. Source: standard Student's t-distribution tables, consistent with NIST's Engineering Statistics Handbook.

Related calculators

Good to know

FAQs

Is this a one-sample or two-sample t-test?

One-sample only. It compares the mean of a single sample against a hypothesized or known population mean. It does not implement a two-sample or Welch's t-test, which compares two independent samples against each other and needs both groups' means, standard deviations, and sizes.

Where does 29 come from in the worked example?

Degrees of freedom for a one-sample t-test is n minus 1. The example uses a sample size of 30, so 30 minus 1 leaves 29 degrees of freedom, which is what the t-distribution's shape depends on.

What goes in the population mean field if I'm not sure what to expect?

That field is the value you're testing against, not something you look up. It might be a manufacturer's claimed spec, a historical average, or a target from a previous study. The test asks whether your sample's mean is different enough from that specific number to matter.

How do I know if my t-statistic counts as significant?

Compare the absolute value of your t-statistic to a critical value from a t-table at your degrees of freedom and chosen significance level; the reference table above has common ones. This calculator reports the t-statistic itself but does not flag significance automatically. For an exact p-value from your t-statistic and degrees of freedom, use the p-value calculator.