One-Sample T-Test Calculator
Use this one-sample t-test calculator to test a population mean using raw or summary data and find the t statistic, p-value, critical value, and a complete step-by-step solution.
How to Use the One-Sample T-Test Calculator
- Select the Alternative Hypothesis: μ ≠ μ₀ (two-tailed), μ > μ₀ (right-tailed), or μ < μ₀ (left-tailed).
- Choose Summary Data and enter x̄, s, n, and μ₀. Or choose Raw Data and enter your observations.
- Set the Significance Level (α), then click Calculate.
The calculator returns the t statistic, p-value, critical value, degrees of freedom, and a full step-by-step solution.
What is a One-Sample T-Test?
A one-sample t-test is a statistical hypothesis test used to determine whether the mean of a single population is equal to a specified value (μ₀). It uses the t-distribution as its reference distribution, which accounts for the additional uncertainty from estimating the population standard deviation from the sample.
When to Use the One-Sample T-Test?
- You have a single sample of continuous data.
- The population standard deviation (σ) is unknown (otherwise use a z-test).
- The data is approximately normally distributed, or the sample size is large enough (n ≥ 30) by the Central Limit Theorem.
- The observations are independent.
One-Sample T-Test Formula
Where:
- x̄ = sample mean
- μ₀ = hypothesized population mean
- s = sample standard deviation
- n = sample size
The resulting t-statistic is compared against the t-distribution with df = n − 1 degrees of freedom.
One-Sample T-Test Example
A manufacturer claims their products weigh exactly 500g. You take a sample of 25 products and find x̄ = 492g, s = 15g. Test at α = 0.05 (two-tailed).
- SE = 15 / √25 = 3
- t = (492 − 500) / 3 = −2.667
- df = 24
- p-value ≈ 0.0135
- Since 0.0135 < 0.05, we reject H₀. There is evidence the mean weight differs from 500g.
Frequently Asked Questions
T-test vs Z-test: which should I use?
Use a t-test when the population standard deviation (σ) is unknown (the most common case). Use a z-test when σ is known. In practice, unless you're told σ is known, always use the t-test.
What are the degrees of freedom?
For a one-sample t-test, degrees of freedom = n − 1. It represents the number of values that are free to vary when computing the sample standard deviation.
My sample size is large (n > 30). Do I still need a t-test?
Yes — if σ is unknown, use the t-test regardless of sample size. For very large samples, the t-distribution and z-distribution become nearly identical, so it doesn't matter much in practice.