How it’s calculated
A t-test asks whether a sample mean (or the difference between two sample means) is far enough from a hypothesized value that chance alone is an unlikely explanation. Enter summary statistics (means, sample standard deviations, sizes); the calculator returns the t statistic, the p-value from Student's t distribution, a confidence interval and the decision at your significance level α.
Which two-sample test? Welch's test does not assume equal variances and is the safer default; the pooled test is slightly more powerful when the two groups really do have the same spread. A paired test is for before/after or matched measurements: take the difference for each pair, then use the mean and SD of those differences.
Example (NIST handbook, miles per gallon): U.S. cars n = 249, mean 20.14458, SD 6.41470; Japanese cars n = 79, mean 30.48101, SD 6.10771. With equal variances assumed, sₚ = 6.34260, t = −12.62059 with 326 degrees of freedom, far beyond the critical value 1.9673, so the means differ at the 5% level. The Welch version gives t = −12.95 with about 137 degrees of freedom and the same conclusion.
Frequently asked questions
What does the p-value mean?
It is the probability of getting a t statistic at least this extreme if the null hypothesis were true. A small p-value (below your α, often 0.05) is evidence against the null hypothesis. It is not the probability that the null hypothesis is true.
Should I use one-tailed or two-tailed?
Use two-tailed unless you decided before seeing the data that only one direction matters. The two-tailed p-value is double the one-tailed value (when t points the predicted way).
Welch or pooled?
Welch is the default in most modern software because it stays valid when the groups have different variances or sizes. Use pooled only if you have good reason to believe equal variances.
What if I have the raw data, not summary statistics?
Work out the mean and sample standard deviation first (the Standard Deviation Calculator does both), then enter them here. Use the n − 1 version of the standard deviation.
Embed this calculator
Add this free calculator to your own website. Copy the code below into your page’s HTML:
Need this calculator branded, changed or built around your own prices?See custom business solutions →
Sources
- NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.5.2 Confidence Limits for the Mean (one-sample t-test and worked example) — NIST
- NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.5.3 Two-Sample t-Test for Equal Means (pooled test and worked example) — NIST
- Introductory Statistics 2e, §10.1 Two Population Means with Unknown Standard Deviations (Welch degrees of freedom) — OpenStax
- Introductory Statistics 2e, §10.4 Matched or Paired Samples — OpenStax
Formulas are taken from the free public references above. Results are provided “as is” for informational and educational purposes only. See our disclaimer.
Added · Last updated · How we check our calculators
Spotted a mistake or missing option? Report a problem· Suggest a calculator