How to use it
- Choose Design: one sample against a value, two independent samples, or paired samples.
- Choose Data: raw values, one per line, or summary statistics. Type Sample 1 values and, for two samples or pairs, Sample 2 values.
- Set the Hypothesised value μ₀, the Alternative hypothesis and the Significance level α.
- Read Conclusion at α, then the t statistic, the p-values and How it is worked out.
How the t statistic is calculated
A t test asks whether an estimate differs from a hypothesised value by more than its random variation would explain. The t statistic divides the difference by the standard error of the estimate. Under the null hypothesis it follows a t distribution, whose degrees of freedom depend on the sample sizes.
For two independent samples, Welch's test does not assume equal variances and is the safer default. The pooled test assumes equal variances and gives the same result when the two samples have equal size and similar spread. A paired test works on the differences between the two values of each pair, which removes the variation between the subjects.
one sample: t = (x̄ − μ₀) ÷ (s ÷ √n), df = n − 1
Welch: SE = √(s₁² ÷ n₁ + s₂² ÷ n₂), t = ((x̄₁ − x̄₂) − μ₀) ÷ SE
pooled: SE = s_p √(1 ÷ n₁ + 1 ÷ n₂), df = n₁ + n₂ − 2
paired: the same as one sample, applied to the differences
The p-value and the decision
The p-value is the probability of a t value at least as extreme as the one found, if H₀ were true. A two-sided test counts both directions; a one-sided test counts only the direction you chose before looking at the data. The decision compares the p-value of the chosen alternative with α: when p is below α, H₀ is rejected. Rejecting H₀ does not show how large the difference is; read the confidence interval for that.
What the calculator does not cover
- More than two groups, which need an analysis of variance, and tests for proportions or counts (see the chi-square test calculator).
- Samples that are not independent beyond the pairing, and data with strong outliers. Look at the values first with the statistics calculator.
- The power of the test and the sample size needed for a difference. Those need the size of the difference you expect.
Worked example: the sleep data of Student (1908)
The extra hours of sleep of ten patients on drug 1 had a mean of 0.75, and on drug 2 a mean of 2.33. Treated as two independent groups, the Welch test gives t = -1.8608 with 17.78 degrees of freedom and a two-tailed p-value of 0.0794, so at α = 0.05 H₀ is not rejected. The 95% interval of the difference is -3.3655 to 0.2055.
The same ten patients took both drugs, so the paired test is the right one. The mean difference is -1.58 hours, t = -4.0621 with 9 degrees of freedom and a two-tailed p-value of 0.0028, so the difference is significant at 5%.
Frequently asked questions
What does a p-value of 0.05 mean?
It means that if H₀ were true, a t value at least as extreme as the one found would occur in about 5 of 100 samples. It is not the probability that H₀ is true, and a smaller p-value is stronger evidence against H₀.
Should I choose the Welch or the pooled test?
Choose Welch unless you have a good reason to believe the two population variances are equal. Welch's test gives nearly the same answer when they are, and a reliable answer when they are not.
When should I use a one-tailed test?
Only when you decided the direction before collecting the data, and a difference in the other direction would not change your action. Otherwise use the two-sided test, which is the usual default.
Why does the calculator say do not reject H₀ rather than accept it?
A non-significant result means the data do not show a difference strong enough to detect with this sample size. It does not prove that the two means are equal, so read the confidence interval as well.
Do my data have to be normally distributed?
The t test is robust for moderate samples when the data are roughly symmetric. With small samples and strong skew or outliers, a rank-based test is safer, and the values should be checked first.
Can I use summary statistics instead of the raw values?
Yes. Choose Summary statistics and type the size, mean and standard deviation of each sample. For a paired test, enter the mean and standard deviation of the differences.
Does the calculator send my data anywhere?
No. The calculation runs in your browser, and nothing you type is sent to our servers.
Sources
- NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.5.2: Confidence limits for the mean
- NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.5.3: Two-sample t-test for equal means
- Wikipedia: Welch's t-test
- Wikipedia: Student's t-test
Figures and text last checked on Tuesday, November 10, 2026.