One-Sample T-Test

Test whether a sample mean differs from a target or hypothesized value when the population standard deviation is unknown, the usual real-world case. Get the t-statistic, degrees of freedom, p-value and confidence interval.

Run One-Sample T-Test →

What is a One-Sample T-Test?

A one-sample t-test compares the mean of a single sample against a known or target value when the population standard deviation is unknown and must be estimated from the sample. This is the most common situation in practice, which makes the t-test far more widely used than the z-test.

Because the standard deviation is estimated, the test uses the t-distribution rather than the normal. The t-distribution has heavier tails that account for the extra uncertainty of estimating variability from a limited sample, and its shape depends on the degrees of freedom (sample size minus one). As the sample grows, the t-distribution approaches the normal.

The test produces a t-statistic, the standardized distance between the sample mean and the target, and a p-value from the t-distribution. A small p-value indicates the sample mean differs significantly from the target value.

In plain terms: You have one group of measurements and a target, and you want to know if the group's average truly differs from it, but you don't know the population's spread, so you estimate it from your data. That estimation is why this uses the t-distribution: it's a bit more cautious than the z-test to account for the guesswork.

Key Features

Unknown Sigma

The population standard deviation is estimated from the sample, which is why the t-distribution is used instead of the normal.

Degrees of Freedom

The t-distribution's shape depends on df = n − 1. Fewer degrees of freedom means heavier tails and a more conservative test.

Approaches Normal

As the sample size grows, the t-distribution converges to the standard normal, and the t-test and z-test agree.

Key Formulas

t = (ȳ − μ₀) / (s / √n)
s = sample standard deviation (estimated)
df = n − 1
p-value from the t-distribution with df degrees of freedom

Interpreting the Result

Compare the p-value with your significance level (commonly 0.05). If p is below alpha, reject the null hypothesis and conclude the sample mean differs significantly from the target value.

Report the confidence interval alongside the p-value. If the target value lies outside the interval, the two-tailed test is significant, and the interval shows the plausible range for the true mean, conveying the magnitude of any difference.

Assumptions & Validation

Random Sampling

Observations are an independent random sample from the population.

If violated: Correct sampling bias; dependence invalidates the test.

Approximate Normality

The data (or the sampling distribution of the mean) is approximately normal; the test is robust for moderate samples.

If violated: For small, clearly non-normal data use the Wilcoxon signed-rank or sign test.

Continuous Data

The variable is measured on a continuous scale.

If violated: Use categorical methods for counts or proportions.

⚠️ Check assumptions first

The one-sample t-test is robust to mild departures from normality, especially with moderate to large samples, but it can be misleading for small samples that are strongly skewed or contain outliers. Check the distribution before relying on the result, and for small non-normal samples switch to the Wilcoxon signed-rank test, which does not assume normality.

When NOT to Use One-Sample T-Test

Known Sigma

If the population standard deviation is genuinely known, the one-sample z-test applies.

Comparing Two Groups

To compare two independent samples, use the two-sample t-test; for paired data, the paired t-test.

Non-normal Small Samples

For small, skewed data, use the Wilcoxon signed-rank test instead.

Industry Applications

Target Conformance

Test whether a process mean meets a specified target when variability is estimated from the sample.

Before-After Benchmarks

Compare a measured average against a documented historical or standard value.

Quality Verification

Confirm whether a batch's mean characteristic matches its nominal specification.

Research & Experiments

Test whether an observed mean differs from a theoretical or reference value.

Frequently Asked Questions

When should I use a one-sample t-test?

Use it when you want to test whether the mean of a single sample differs from a known target or reference value, and the population standard deviation is unknown and estimated from the sample. This is the most common case in practice. If the population standard deviation is genuinely known, the one-sample z-test applies instead, though the two agree closely for large samples.

Why does the t-test use the t-distribution instead of the normal?

Because the population standard deviation is estimated from the sample, there is extra uncertainty that the normal distribution does not account for. The t-distribution has heavier tails to reflect this added uncertainty, making the test appropriately more conservative, especially for small samples. As the sample size increases, the estimate improves and the t-distribution converges to the normal.

What are degrees of freedom in a one-sample t-test?

The degrees of freedom equal the sample size minus one. They determine the exact shape of the t-distribution used to compute the p-value: fewer degrees of freedom produce heavier tails and a more conservative test, while more degrees of freedom bring the distribution closer to the normal. The single degree lost reflects the estimation of the mean from the data.

Is the t-test sensitive to non-normal data?

The one-sample t-test is fairly robust to mild departures from normality, particularly as the sample size grows, because the sampling distribution of the mean tends toward normal. However, for small samples that are strongly skewed or have outliers, the test can mislead. In those cases the Wilcoxon signed-rank test, a non-parametric alternative, is preferable.

What is the difference between a one-sample and a paired t-test?

A one-sample t-test compares a single sample's mean to a fixed target value. A paired t-test compares two related measurements on the same subjects, such as before and after, by testing whether the mean of their differences is zero. The paired test is effectively a one-sample t-test applied to the difference scores, which is why the two are closely connected.

How do I interpret the confidence interval?

The confidence interval gives the plausible range for the true population mean at your chosen confidence level. If the target value lies outside this interval, the two-tailed test is significant at the corresponding level. Beyond significance, the interval communicates the magnitude and direction of the difference, which is essential for judging whether a statistically significant result is also practically important.

Test a Mean When Sigma Is Unknown

Run a one-sample t-test with t-statistic, df, p-value and interval. Free during Beta.

Run One-Sample T-Test →