331+ free tools. No sign-up. No hidden fees. Explore the toolkit

T-Test Calculator

A t-test tells you whether a sample mean is really different from what you expected — or whether two groups genuinely differ. This calculator runs one-sample tests from summary statistics or raw data, and two-sample tests with Welch’s or Student’s method, and gives you the t-statistic, the p-value and the 95% confidence interval.

A t-test asks whether the difference between two averages is real or just chance. Choose the test that matches your data, enter your numbers, and get the t-statistic, degrees of freedom, p-value and 95% confidence interval instantly.

Result

Save to Pinterest
Note: P-values are computed with the regularized incomplete beta function, accurate to about 1e-12 — the same method used by R and SciPy, cross-checked against SciPy 1.11.4. A t-test assumes your data is roughly normally distributed and the observations are independent. This calculator is for education and quick checks — it is not a substitute for professional statistical advice.

How It Works

A t-test turns the gap between what you observed and what the null hypothesis predicts into a t-statistic, then asks how surprising that value is under the t distribution. For a one-sample test, t = (x̄ − μ₀) ÷ (s ÷ √n), where x̄ is the sample mean, s the sample standard deviation, n the sample size and μ₀ the hypothesized mean. The degrees of freedom are n − 1.

For two samples, the t-statistic is the difference in means divided by the standard error of that difference, and the degrees of freedom depend on the method: Welch’s version uses the Welch–Satterthwaite equation (a fractional value), while Student’s pooled version uses n₁ + n₂ − 2. With three or more groups, the right tool is an ANOVA calculator — running a t-test on every pair inflates the false-positive rate.

The p-value comes from the t distribution’s cumulative distribution function, computed here with the regularized incomplete beta function — accurate to about 1e-12, the same method used by R and SciPy. The 95% confidence interval is the estimate plus or minus the critical t-value (the 97.5th percentile of the t distribution) times the standard error. If the interval excludes the null value, the test is significant at α = 0.05 — the two always agree.

Worked Example

One-sample, summary: a sample of 25 students has a mean score of 105 and a standard deviation of 15. Testing against a hypothesized mean of 100: t = (105 − 100) ÷ (15 ÷ √25) = 5 ÷ 3 = 1.6667, with 24 degrees of freedom, a two-tailed p-value of 0.1086 (one-tailed 0.0543) and a 95% confidence interval of 98.8083 to 111.1917 — not significant at α = 0.05. One-sample, data: the values 2, 4, 6, 8, 10 have mean 6 and sample SD 3.1623; against μ₀ = 5, t = 0.7071, df = 4, two-tailed p = 0.5185.

Two-sample: group A (22, 25, 27, 24, 26) has mean 24.8 and SD 1.9235; group B (18, 20, 19, 21, 17) has mean 19.0 and SD 1.5811. Welch’s test gives t = 5.2086, df = 7.7111, two-tailed p = 0.0009 — significant at α = 0.05. The pooled (Student) version gives t = 5.2086, df = 8, p = 0.0008.

Assumptions

Last reviewed: 15 November 2026.

Built and tested by SumKitTool — see how we check our numbers.

How to Use This Calculator

Pick a test type, enter your data, and the result updates live as you type.

  1. Choose the test type — one-sample from summary statistics (mean, SD, n), one-sample from raw data, or two-sample to compare two groups.
  2. Enter your numbers — paste data separated by commas, spaces or new lines, and set the hypothesized mean (one-sample) or the method, Welch or Student (two-sample).
  3. Read the answer — the t-statistic, degrees of freedom, two-tailed and one-tailed p-values, the 95% confidence interval and the verdict at α = 0.05.

The Reset button restores the worked example (mean 105, SD 15, n = 25, μ₀ = 100 — t = 1.6667, p = 0.1086).

Tips and Practical Advice

Frequently Asked Questions

What is a t-test used for?

A t-test checks whether a sample mean differs from a value you expect, or whether two groups differ from each other. Use a one-sample t-test to compare one mean against a known value (for example, is this class's average score different from 100?), and a two-sample t-test to compare two groups (for example, do two teaching methods give different scores?). It is the right test when the population standard deviation is unknown — which is almost always.

What is the difference between a Welch and a Student t-test?

Welch's t-test does not assume the two groups have equal variances, and it adjusts the degrees of freedom for that — it is the safer default, and what this calculator uses unless you choose otherwise. Student's t-test pools the two variances into one estimate and assumes they are equal; if that assumption is wrong, its p-value can be misleading. When the groups are the same size the two tests often agree closely.

How do I read the p-value from a t-test?

The p-value is the chance of seeing a difference at least this large if there were really no difference at all. If p is below your significance level — usually 0.05 — the result is statistically significant and you reject the null hypothesis. For example, p = 0.1086 is not significant at 0.05, while p = 0.0009 is. A p-value is not the probability that the null hypothesis is true.

What is the difference between a one-tailed and a two-tailed t-test?

A two-tailed test asks whether the mean differs in either direction, and is the standard choice. A one-tailed test asks about one direction only — for example, whether the mean is greater than the hypothesised value. The one-tailed p-value in the observed direction is half the two-tailed p-value: with t = 1.6667 and 24 degrees of freedom, the two-tailed p-value is 0.1086 and the one-tailed p-value is 0.0543. Only use a one-tailed test if you chose the direction before seeing the data.

Last updated: