statistics calculators

One-Sample T-Test Calculator

Test whether your sample mean differs significantly from a known population mean. Use this when evaluating survey results, quality control data, or any study where you have one group and a benchmark to compare against.

About this calculator

The one-sample t-test determines whether the mean of a sample is statistically different from a hypothesized population mean (H₀). The test statistic is calculated as t = (x̄ − μ₀) / (s / √n), where x̄ is the sample mean, μ₀ is the population mean under the null hypothesis, s is the sample standard deviation, and n is the sample size. The resulting t-value is then compared to a critical value from the t-distribution with n − 1 degrees of freedom. A two-tailed test checks for any difference, while one-tailed tests check for a specific direction. If |t| exceeds the critical value at your chosen significance level (e.g., α = 0.05), you reject the null hypothesis and conclude the difference is statistically significant.

How to use

Suppose a factory claims its bolts average 50 mm. You measure 25 bolts and find a sample mean of 51.2 mm with a standard deviation of 2.5 mm. Enter: Sample Mean = 51.2, Population Mean = 50, Standard Deviation = 2.5, Sample Size = 25. The t-statistic = (51.2 − 50) / (2.5 / √25) = 1.2 / 0.5 = 2.40. With 24 degrees of freedom and α = 0.05 (two-tailed), the critical value is roughly 2.064. Since 2.40 > 2.064, you reject H₀ and conclude the bolts are significantly longer than claimed.

Frequently asked questions

What is the difference between a one-tailed and two-tailed t-test?

A two-tailed test checks whether the sample mean is significantly different from the population mean in either direction — higher or lower. A one-tailed test checks only one direction, such as whether the sample mean is specifically greater than or specifically less than the population mean. You should choose your test type before collecting data based on your research question. Using a one-tailed test when you expect a specific direction makes it easier to detect that effect, but you cannot then claim significance in the other direction.

How many samples do I need for a one-sample t-test to be valid?

There is no strict minimum, but the t-test assumes the data are approximately normally distributed. For small samples (n < 30), this normality assumption matters a lot, and you should verify it with a normality test or a Q-Q plot. For larger samples (n ≥ 30), the Central Limit Theorem ensures the sampling distribution of the mean is approximately normal regardless of the original distribution. In practice, even n = 10–15 can be acceptable if your data show no severe skew or outliers.

What does a p-value mean in the context of a one-sample t-test?

The p-value is the probability of observing a t-statistic as extreme as yours (or more extreme) if the null hypothesis were actually true. A small p-value (commonly below 0.05) suggests the result is unlikely under H₀, providing evidence to reject it. Importantly, the p-value does not tell you the probability that H₀ is true, nor does it measure the size or practical importance of the difference. Always pair your p-value with effect size measures like Cohen's d to understand the real-world significance of your finding.