One-Sample t-Test Calculator

This calculator performs a one-sample t-test, which checks whether the mean of your sample differs significantly from a specific value you have in mind. It answers a common question: is my data consistent with a particular target, standard or claim? You might test whether the average weight of a product matches its labelled value, whether students' average score differs from a national benchmark, or whether a process mean has drifted from its target. The test compares the gap between your sample mean and the hypothesized value against the variability in your data, producing a t statistic. A large t, far from zero, suggests the true mean really does differ from the test value; a small t suggests any difference could be chance. This calculator does the work. You paste your sample data and enter the hypothesized mean to test against, and it returns the t statistic, the sample mean, the degrees of freedom, and the value you tested. The results update as you type. Use it for statistics study, for quality control, or to test whether a measured average matches a claimed or target figure. The t statistic is the difference between the sample mean and the hypothesized value, divided by the standard error of the mean, which is the sample standard deviation over the square root of the sample size. The degrees of freedom are one less than the sample size. To complete the test, compare the magnitude of t against the critical value from the t distribution at your chosen significance level and degrees of freedom, or find the p-value; if the magnitude exceeds the critical value, the difference is statistically significant. The test assumes the sample is drawn from a roughly normal distribution, which matters most for small samples.

Calculate.co.nz is proud to be partnered with Health Based Building, a leader in sustainable and health-conscious building innovation. With over a century of experience, they develop high-performance systems like Foreverbreathe Specification, Magnum Board, and Foreverbreathe Paints to support energy-efficient, non-toxic living environments. Their commitment to healthier homes aligns with our belief that informed choices lead to better outcomes for Kiwi households.
Calculate.co.nz partner: Health Based Building
Advertise on this page
3.14
t statistic
Sample mean6.6
Degrees of freedom4
Tested against5

t = (sample mean - hypothesized mean) / (sample SD / sqrt n). Degrees of freedom = n - 1. Compare against a t table. Assumes a roughly normal sample.

How it works

The calculator finds the sample mean and sample standard deviation. The standard error of the mean is the standard deviation divided by the square root of the sample size. The t statistic is the difference between the sample mean and the hypothesized value, divided by that standard error. The degrees of freedom are the sample size minus one.

Worked example

For the data 5, 7, 6, 8, 7, the sample mean is 6.6 and the sample standard deviation is about 1.14. Testing against a hypothesized mean of 5, the standard error is 1.14 over the square root of 5, about 0.51, so t is 1.6 divided by 0.51, about 3.14, with 4 degrees of freedom.

Related calculators