This free t-test calculator runs a one-sample, two-sample or paired t-test from your summary statistics or raw data. It gives the t statistic, degrees of freedom, p-value and a confidence interval, tells you whether the result is significant, and shades the rejection region on a live t-distribution chart.
T-Test Calculator
One-sample, two-sample (Welch or pooled) and paired t-tests
Group 1
Group 2
Differences are worked out as After − Before (condition 2 − condition 1).
How to Use the T-Test Calculator
- Pick the test: one sample, two independent samples or paired samples.
- Choose whether to type summary statistics (mean, standard deviation, sample size) or paste raw data.
- Fill in the boxes. For a one-sample test, also enter the hypothesized mean μ₀.
- Pick the alternative hypothesis (two-tailed, left or right) and a significance level, usually 0.05.
- Press Calculate. Use Load example to see a filled-in test first.
Which T-Test Should You Use?
| Your data | Test | Example question |
|---|---|---|
| One group compared with a fixed value | One-sample t-test | Do these bottles hold 500 mL on average? |
| Two separate groups of different people or items | Two-sample (independent) t-test | Do two classes score differently on the same quiz? |
| The same people measured twice, or matched pairs | Paired t-test | Did typing speed change after two weeks of practice? |
For two independent groups, the calculator uses Welch's t-test by default because it does not assume the two groups have equal variances. Tick the equal-variances box only if you have a good reason to assume the spreads are the same.
T-Test Formulas
| Test | t statistic | Degrees of freedom |
|---|---|---|
| One sample | t = (x̄ − μ₀) ÷ (s ÷ √n) | n − 1 |
| Paired | t = d̄ ÷ (sd ÷ √n) | n − 1 (n = number of pairs) |
| Two sample, Welch | t = (x̄₁ − x̄₂) ÷ √(s₁²/n₁ + s₂²/n₂) | Welch–Satterthwaite formula |
| Two sample, pooled | t = (x̄₁ − x̄₂) ÷ (sp √(1/n₁ + 1/n₂)) | n₁ + n₂ − 2 |
These are the same formulas the NIST/SEMATECH e-Handbook of Statistical Methods gives for the two-sample t-test, including the Welch–Satterthwaite degrees of freedom.
Source: NIST/SEMATECH e-Handbook, "Two-Sample t-Test for Equal Means".
Worked Example: A Paired T-Test
Eight students record their typing speed in words per minute, practice for two weeks, then test again. Did their speed change? (Illustrative numbers.)
| Student | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|
| Before | 42 | 38 | 51 | 45 | 36 | 48 | 40 | 44 |
| After | 46 | 41 | 52 | 50 | 39 | 51 | 43 | 49 |
| Difference | 4 | 3 | 1 | 5 | 3 | 3 | 3 | 5 |
| Step | Working | Result |
|---|---|---|
| 1. Mean difference | (4+3+1+5+3+3+3+5) ÷ 8 | d̄ = 3.375 |
| 2. SD of differences | sample standard deviation | sd = 1.302 |
| 3. Standard error | 1.302 ÷ √8 | 0.4605 |
| 4. t statistic | 3.375 ÷ 0.4605 | t = 7.33 |
| 5. p-value (two-tailed, df = 7) | area beyond ±7.33 | p = 0.00016 |
| 6. Decision at α = 0.05 | 0.00016 < 0.05 | Reject H₀ |
The average speed rose by about 3.4 words per minute, and a change this consistent would be very unlikely if practice made no difference. Choose Paired samples and Load example above to see the same result.
How to Read Your Result
- t statistic: how many standard errors the difference is from zero (or from μ₀). Bigger in either direction means stronger evidence.
- p ≤ α: statistically significant. Data this extreme would be unlikely if the null hypothesis were true.
- p > α: not significant. That does not prove the means are equal; the evidence is just not strong enough.
- Confidence interval: a range of plausible values for the true mean or difference. If a two-tailed interval for a difference does not include 0, the test is significant at that α.
New to the idea? Start with our plain-English guide, what is a t-test, read about hypothesis testing, see how the standard error fits in, or turn any t score into a p-value with the P-Value Calculator.
Frequently Asked Questions
What does a t-test calculator tell you?
It tells you whether a difference in means is larger than you would expect from random sampling alone. You get the t statistic, the degrees of freedom and a p-value. Compare the p-value with your significance level to decide whether to reject the null hypothesis.
Should I use Welch's or the pooled two-sample t-test?
Welch's version is the safer default. It works whether or not the two groups have equal variances and handles unequal sample sizes well. The pooled version is slightly simpler and gives almost the same answer when the spreads and sizes are similar.
Why are my Welch degrees of freedom a decimal?
The Welch–Satterthwaite formula blends both sample sizes and variances, so it rarely lands on a whole number. That is normal. The calculator uses the exact decimal value to find the p-value.
Can I use a t-test with a small sample?
Yes. The t-test was designed for small samples. With very small samples, though, the data should look roughly bell-shaped with no extreme outliers, because the test relies on that assumption more when n is small.
More Free Tools
P-Value Calculator · Confidence Interval Calculator · Standard Error Calculator · Variance Calculator · Z-Score Calculator · Correlation Coefficient Calculator · Linear Regression Calculator · Probability Calculator
See every tool on our free statistics and math tools page.
This calculator is for learning and everyday use. Double-check important results, and follow your teacher's or school's method for graded work.