How to use the t-test calculator
- Pick the type of t-test: one-sample (one group against a fixed value), two-sample (two separate groups) or paired (the same subjects measured twice).
- Paste your raw data, or switch to summary statistics and enter each group's mean, standard deviation and size.
- Enter the hypothesized value. For a one-sample test, this is the mean you're testing against; for the other tests it is usually 0 (no difference).
- Choose the alternative hypothesis and significance level, then click Run t-test.
- Read the decision, the effect size and the plain-English summary, and download the chart if you need it.
T-test formulas
Every t-test divides the difference you observed by its standard error. The result, t, follows a t distribution when the null hypothesis is true.
One-sample: t = x − μ0s / n , df = n − 1
Paired: t = d − μ0sd / n , df = n − 1
Two-sample (Welch): t = x1 − x2s12n1 + s22n2
Two-sample (pooled): t = x1 − x2sp 1n1 + 1n2 , df = n1 + n2 − 2
- x
- The sample mean (with subscripts 1 and 2 for the two groups)
- d
- The mean of the paired differences (second measurement minus first)
- μ0
- The value in the null hypothesis: the mean (one-sample) or difference (paired, two-sample) you test against, usually 0 for differences
- s
- The sample standard deviation; sd is the standard deviation of the differences
- sp
- The pooled standard deviation, combining both groups' variances weighted by their degrees of freedom
- n
- The sample size (the number of pairs for a paired test)
- df
- Degrees of freedom. Welch's test uses the Welch-Satterthwaite formula, which usually gives a non-whole number
Worked example
A school reports that its students average 100 on a standard reasoning test. A researcher tests 25 students and gets a mean of 103.2 with a standard deviation of 9.6. Is the true mean different from 100, at α = 0.05?
-
State the hypotheses (two-tailed)
H0: μ = 100 H1: μ ≠ 100
-
Standard error of the mean
SE = 9.625 = 9.65 = 1.92
-
Calculate the t statistic
t = 103.2 − 1001.92 = 1.6667
-
Degrees of freedom and two-tailed p-value
df = 24, p = 2 × P(T ≥ 1.6667) = 0.1086
-
Compare with α
0.1086 > 0.05 → fail to reject H0
What it means: the sample mean is 3.2 points above 100, but with this much variation and only 25 students, a gap that size would happen about 11% of the time by chance alone. That isn't strong enough evidence to say the true mean differs from 100. A larger sample might detect a real difference if there is one.
How to interpret t-test results
- p ≤ α: the difference is statistically significant. The data give evidence that the true mean (or difference) is not the hypothesized value.
- p > α: not significant. The difference could plausibly be random variation. This does not prove the means are equal.
- The sign of t shows the direction: a positive t means the first mean is larger than the second (or larger than μ0).
- Cohen's d shows how large the difference is in practical terms. With big samples, even a tiny, unimportant difference can be significant.
- The confidence interval for the difference gives a range of plausible values. If it excludes 0, the two-tailed test is significant at the matching level.
Already have a t statistic from software or a textbook? Use the p-value calculator to convert it straight into a p-value. Planning a study? The sample size calculator helps you collect enough data to detect the effect you care about.