One-Sample t-Test Calculator
The one-sample t-test examines whether the mean of a single group differs significantly from a predetermined reference value (μ₀). It is the test that decides whether a class average departs from the national average, whether the mean weight of manufactured parts departs from the nominal value, or whether the mean score on a scale departs from its theoretical midpoint.
The calculator works with raw data as well as with summary statistics alone (x̄, s, n). It reports the t statistic, the degrees of freedom, the p-value for the direction you select, the critical t, the difference between the means with its confidence interval, and the Cohen d effect size with its label; the shaded t curve shows visually where you stand relative to the rejection region.
One-Sample t-Test Formulas
Hypotheses: H₀: μ = μ₀ · H₁: μ ≠ μ₀ (two-tailed) Standard error: SE = s / √n Test statistic: t = (x̄ − μ₀) / SE Degrees of freed.: df = n − 1 Confidence int.: (x̄ − μ₀) ± t₍₁−α/₂; df₎ · SE Effect size: d = (x̄ − μ₀) / s Critical value: two-tailed ±t₍₁−α/₂₎ · one-tailed t₍₁−α₎
Cohen d thresholds: 0.20 small · 0.50 medium · 0.80 large. The p-value is taken from one or both tails of the t distribution, depending on the hypothesis direction you select.
How to Calculate
- Paste your raw data, or switch to summary statistics mode and enter x̄, s, and n.
- Enter the test value (μ₀) the mean will be compared with: a benchmark score, a nominal value, or a theoretical midpoint.
- Set the hypothesis direction; if you cannot justify a direction in advance, stay with the two-tailed option.
- Choose the significance level (α) and the confidence level; α = 0.05 and 95% are the most common choices in the literature.
- Read the t value, the degrees of freedom, and the p-value together with the decision line, and see on the shaded t curve whether t falls inside the rejection region.
- Report the confidence interval for the difference and the Cohen d value: significance alone says nothing about the size of the effect.
Worked Examples
Exam scores from raw data
The 12 students have a mean of 73.58 and a standard deviation of 3.75. The standard error is 1.08, so t = 3.308 and, with df = 11, p = 0.007; because that falls below the α = 0.05 threshold, H₀ is rejected. The mean difference is 3.58 units, the 95% confidence interval for the difference runs from 1.20 to 5.97, and Cohen d = 0.955 points to a large effect.
t statistic: 3.3077 · Degrees of freedom (df): 11 · p-value: p = 0.007
One-tailed test from summary statistics
For x̄ = 78, s = 12, and n = 30 the standard error is 2.19; this gives t = 1.369 with df = 29. In a right-tail test p = 0.091, so H₀ cannot be rejected at the α = 0.05 level. The 95% confidence interval for the difference runs from -1.48 to 7.48 and therefore includes zero; Cohen d = 0.250 is a small effect.
t statistic: 1.3693 · Degrees of freedom (df): 29 · p-value: p = 0.091
A non-significant production check
The 10 packages have a mean of 500.00 grams and a standard deviation of 1.83 grams. Because the difference is exactly 0, t = 0.000 and p = 1.000; H₀ cannot be rejected and production is treated as not departing from the nominal value. The 95% confidence interval for the difference runs from -1.31 to 1.31 grams.
t statistic: 0.0000 · Degrees of freedom (df): 9 · p-value: p = 1.000