Run a One-Sample t-Test
Enter summary statistics from your sample to test whether your sample mean differs from a hypothesized population mean.
What is a one-sample t-test?
A one-sample t-test is used when you want to compare the mean of a single sample to a known or hypothesized population mean. It answers the question:
- “Is my sample mean statistically different from a target value?”
For example, if your team claims that users spend 30 minutes per day in your app, and your sample average is 27.8 minutes, a one-sample t-test helps determine whether that difference is likely due to random chance or suggests a real deviation from 30.
Formula used by the calculator
The calculator computes the t statistic using:
df = n - 1
Where:
- x̄ = sample mean
- μ₀ = hypothesized population mean
- s = sample standard deviation
- n = sample size
- df = degrees of freedom
How to use this calculator
- Enter the hypothesized mean (μ₀).
- Enter your sample mean (x̄), standard deviation (s), and sample size (n).
- Select the alternative hypothesis:
- Two-tailed: mean is different
- Right-tailed: mean is greater
- Left-tailed: mean is smaller
- Choose α (e.g., 0.05), then click Calculate.
The tool returns t, degrees of freedom, p-values, confidence interval, and a plain-language decision statement.
Interpretation guide
p-value
If your selected p-value is less than α, reject the null hypothesis. Otherwise, fail to reject it.
Confidence interval
The confidence interval gives a range of plausible population means. If μ₀ falls outside the interval (for a two-sided test), that aligns with statistical significance.
Effect size (Cohen's d)
Cohen's d is reported as a standardized difference:
- ~0.2 small
- ~0.5 medium
- ~0.8 large
Assumptions of the one-sample t-test
- Data are from a random or representative sample.
- Observations are independent.
- The underlying distribution is approximately normal, especially important for small n.
- No extreme outliers that dominate the sample mean.
Worked mini example
Suppose:
- μ₀ = 100
- x̄ = 104.2
- s = 12.5
- n = 36
The standard error is 12.5 / √36 = 2.083. The t statistic is (104.2 - 100) / 2.083 ≈ 2.02 with df = 35. A two-tailed p-value around 0.051 would be just above α = 0.05, indicating a borderline but not conventionally significant result.
Common mistakes to avoid
- Using population standard deviation instead of sample standard deviation.
- Choosing a one-tailed test after seeing the data (post-hoc).
- Confusing “fail to reject” with “prove no effect.”
- Ignoring practical significance even when p-value is very small.