How to use the t-test calculator
Choose what you are comparing: two groups, the same people before and after, or one group against a number. Paste the numbers of each group (a column from Excel works), or switch to summary numbers and type the mean, standard deviation and number of values. The p-value, the confidence interval and a picture of your data appear as you type.
Pick “Different”, “Higher” or “Lower” for a two-tailed or one-tailed test and leave the significance level empty for 0.05. Go advanced to test against a difference other than 0, change the confidence level, name your groups, type the standard error instead of the standard deviation, or type just a t-score and degrees of freedom.
The formulas
For the pooled test, replace the square root by sₚ × √(1 ÷ n₁ + 1 ÷ n₂), where sₚ² = ((n₁ − 1)s₁² + (n₂ − 1)s₂²) ÷ (n₁ + n₂ − 2). Worked out with this calculator for 8 values in each group (means 83.00 and 78.00, standard deviations 5.53 and 6.39): Welch t = 1.6733 with 13.72 degrees of freedom and p = 0.1169; pooled t = 1.6733 with 14 degrees of freedom and p = 0.1165. The 95% interval for the difference of 5.00 runs from −1.42 to 11.42 (Welch) and from −1.41 to 11.41 (pooled).
Which t-test should I use?
| Your data | Test |
|---|---|
| One group, compared with a known number (a target, a standard, a claim) | One-sample t-test |
| The same people or things measured twice (before and after, left and right) | Paired t-test |
| Two separate groups, spreads clearly different or unknown | Welch two-sample t-test |
| Two separate groups with the same spread | Pooled two-sample t-test (Welch gives almost the same answer) |
| Three or more groups | Not a t-test: use analysis of variance |
Paired and one-sample examples
Paired: blood pressure before (120, 132, 118, 140, 125, 135, 128, 122) and after (115, 128, 119, 131, 120, 130, 126, 117) for 8 people. The differences have a mean of 4.25 and a standard deviation of 2.87, so t(7) = 4.19 and p = 0.004065: significant at 0.05.
One sample: 10 measurements (102, 98, 110, 95, 104, 108, 99, 106, 101, 97) compared with a target of 100. The mean is 102.00, t(9) = 1.28 and p = 0.2328: not significant at 0.05.
Critical t-values
A t-score beyond the critical value for your degrees of freedom is significant at that level. Two-tailed values; for a one-tailed test use the column of twice the level (for example the α = 0.10 column for a one-tailed test at 0.05).
| Degrees of freedom | α = 0.10 | α = 0.05 | α = 0.01 |
|---|---|---|---|
| 1 | 6.314 | 12.706 | 63.657 |
| 2 | 2.920 | 4.303 | 9.925 |
| 3 | 2.353 | 3.182 | 5.841 |
| 4 | 2.132 | 2.776 | 4.604 |
| 5 | 2.015 | 2.571 | 4.032 |
| 6 | 1.943 | 2.447 | 3.707 |
| 7 | 1.895 | 2.365 | 3.499 |
| 8 | 1.860 | 2.306 | 3.355 |
| 9 | 1.833 | 2.262 | 3.250 |
| 10 | 1.812 | 2.228 | 3.169 |
| 12 | 1.782 | 2.179 | 3.055 |
| 15 | 1.753 | 2.131 | 2.947 |
| 20 | 1.725 | 2.086 | 2.845 |
| 25 | 1.708 | 2.060 | 2.787 |
| 30 | 1.697 | 2.042 | 2.750 |
| 40 | 1.684 | 2.021 | 2.704 |
| 60 | 1.671 | 2.000 | 2.660 |
| 120 | 1.658 | 1.980 | 2.617 |
| ∞ (normal curve) | 1.645 | 1.960 | 2.576 |
Reading the result
The p-value is the probability of a difference at least as large as yours if there were really none. Compare it with your significance level α: below it, the result is called significant. The confidence interval shows the range of differences the data are consistent with; if it includes 0 (or the value you test against), the result is not significant at the matching level. Cohen’s d divides the difference by the spread, so it shows how big the difference is compared with the variation, not just whether it is detectable. A significant result with a tiny d can be unimportant; a non-significant result from a small sample can still hide a real difference, which is what the “What would it take?” table helps you judge.
Check against a published example
The NIST/SEMATECH handbook compares the fuel economy of 249 US cars (mean 20.14458, standard deviation 6.4147) with 79 Japanese cars (mean 30.48101, standard deviation 6.10771) using the pooled test. This calculator, given those summary numbers, returns t = −12.6206 with 326 degrees of freedom; the two-tailed critical value is 1.9673 and the one-tailed one 1.6495, so the means are different at the 0.05 level.
How many people do I need?
With the example data above (8 per group), the calculator reports that about 13 per group would give p below 0.05 if the means and standard deviations stayed the same, and 24 per group would give 80% power to detect the observed difference. The power of the test as run is 34.4%.
Related tools
To turn any t-score into a p-value or find critical values use the p-value calculator; for an interval around one mean the confidence interval calculator; to standardise a value the z-score calculator; and to find a spread the standard deviation calculator.
Sources
- The one-sample, paired and two-sample t statistics, the pooled formula, the Welch–Satterthwaite degrees of freedom, the threshold form of the null hypothesis (a difference of d₀) and the critical regions for the two-tailed and one-tailed alternatives follow the NIST/SEMATECH e-Handbook of Statistical Methods, section 1.3.5.3 “Two-Sample t-Test for Equal Means”. The interval estimate x̄ ± t × s ÷ √N with N − 1 degrees of freedom follows section 1.3.5.2 “Confidence Limits for the Mean”. Both pages read on 2026-11-22.
- Check: with the handbook’s miles-per-gallon summary (US cars n = 249, mean 20.14458, standard deviation 6.4147; Japanese cars n = 79, mean 30.48101, standard deviation 6.10771) this calculator gives t = −12.6206 with 326 degrees of freedom, and critical values 1.9673 (two-tailed) and 1.6495 (one-tailed), the values printed in the handbook.
- The feature set was compared with the t-test tools of Omnicalculator, GraphPad QuickCalcs, Social Science Statistics and Stats Kingdom, all opened on 2026-11-22. The statements about assumptions (independent values, roughly bell-shaped data) follow the descriptions on those pages. Probabilities come from the t distribution of this site’s p-value calculator. Power uses the noncentral t distribution, computed numerically.
- No rule-of-thumb labels (small, medium, large) are attached to Cohen’s d, because no primary source for them was read.
For information only. Check the assumptions of the test and your own data before drawing conclusions.
Common questions
What is a t-test?
A t-test checks whether an average differs from a number, or whether two averages differ, by comparing the gap with the amount of random variation expected from the sample sizes. The result is a t-score and a p-value.
Which t-test should I use?
Use a one-sample t-test to compare one group with a known number, a paired t-test for the same people measured twice, and a two-sample t-test for two separate groups. When unsure about two groups, choose Welch: it does not assume equal variances. This page shows Welch and pooled together.
What is the difference between Welch and pooled?
The pooled test assumes both groups have the same variance and uses one combined spread, with n₁ + n₂ − 2 degrees of freedom. Welch uses each group’s own variance and the Welch–Satterthwaite degrees of freedom. For the example on this page, Welch gives p = 0.1169 and pooled p = 0.1165.
How do I read the p-value?
The p-value is the probability of a result at least as extreme as yours if there were really no difference. If it is below your significance level α (usually 0.05), the result is called statistically significant. A p-value of 0.1169 is above 0.05, so the example is not significant.
One-tailed or two-tailed?
Use two-tailed to test for a difference in either direction. Use one-tailed (higher or lower) only when you decided before looking at the data that only one direction matters. The one-tailed p-value is half the two-tailed one when the difference points the chosen way.
What do the degrees of freedom mean?
For one sample and paired tests they are n − 1. For the pooled two-sample test n₁ + n₂ − 2. For Welch they are a formula that is usually not a whole number: 13.72 in the example.
What does the confidence interval tell me?
It is a range of differences the data are consistent with. For the example it runs from −1.42 to 11.42, which includes 0, matching the non-significant p-value. If an interval does not include the tested value, the result is significant at the matching level.
How many people do I need?
The “What would it take” table shows how many people per group would give p below α if the means and spreads stayed the same (13 per group in the example), and how many are needed for 80% power at the difference you saw (24 per group). It is a planning guide, not proof of anything.
What are the assumptions of a t-test?
The values are independent and the data are roughly bell-shaped, especially with small samples. Check the dots in the picture for outliers; the tables flag values beyond 1.5 × the interquartile range. With very small samples and strong outliers, other tests may fit better.
Can I use summary numbers instead of the data?
Yes. Choose “Use summary numbers” and type the mean, standard deviation and number of values of each group. In Go advanced you can type the standard error instead of the standard deviation, or just a t-score and degrees of freedom to get the p-value.