Run a t-test
T-TESTPaste the scores, or type the n, mean and standard deviation from a paper. You get t, the degrees of freedom, p both ways, the difference with its confidence interval, Cohen's d, and the sentence for a write-up.
Free to use. Saving the result as a file needs a paid plan. Gnosis adds projects, APA tables and reports.
The test
The numbers
One value a line, or separated by spaces or commas. Paste a column straight from a spreadsheet.
The result
For the write-up
Free to run and copy. Saving the report needs a paid plan.
How it works
Paste the scores, or type the n, mean and standard deviation from a paper. T-TEST works out t, the degrees of freedom, p both ways, the difference with its confidence interval and Cohen’s d, with Student’s and Welch’s side by side and Levene’s test beside them, and writes the sentence for a write-up. It runs in this tab.
In more detail
T-TEST works from two columns pasted from a spreadsheet, or from the summary figures printed in a paper. Levene's test sits beside the independent test so the choice between Student and Welch is in view, and every figure is held to SciPy. Nothing typed here leaves this tab.
What it does, and what it does not
A t-test asks whether a difference in means is larger than the scatter in the data would produce by chance. This page runs the four common versions: two independent groups with equal variances assumed (Student) or not (Welch), the same people measured twice (paired), and one group against a fixed value. The p-value is worked out from Student's t distribution directly, not looked up in a table, and the confidence interval uses the same distribution, so the two always agree.
It does not test three or more groups (that is an analysis of variance), and it does not run the rank-based tests, Mann-Whitney and Wilcoxon, that suit small samples far from normal. It does not check normality beyond what you can see, and it does not work out how many people a study needs. It does not correct for running many tests. Missing values are simply left out: in paired data a line with a value missing on either side is dropped, and the count says so.
The convention used for each figure is stated beside it. Cohen's d for two groups is over the pooled standard deviation whichever test is chosen, and Hedges' g is shown with it for small samples. The one-tailed p is in the direction the difference went, which is only fair if that direction was predicted. Every figure is held to SciPy in this site's own tests. To describe a single column first, FIGURES does that, and CHI-SQUARE tests counts rather than scores.
The guide: An SPSS alternative that opens .sav files in your browser
Questions people ask about T-TEST
Should I use Student’s t-test or Welch’s?
Welch’s, unless you have a reason not to. Student’s test assumes the two groups have the same variance; Welch’s does not, and when the variances are in fact equal it gives almost the same answer. When they are not, and especially when the smaller group has the larger spread, Student’s p-value can be badly wrong. Both are shown here side by side, with Levene’s test, so the choice is visible.
What is the difference between a one-tailed and a two-tailed p-value?
A two-tailed p asks how surprising a difference this large would be in either direction; a one-tailed p asks only about the direction you predicted, and is half the size when the result goes that way. A one-tailed test is honest only when the direction was fixed before the data were seen, which reviewers often doubt. The page gives both and labels which is which.
Can I run a t-test from a paper’s means and standard deviations?
Yes. Choose 'The n, mean and SD' and type them in. That is enough for Student’s and Welch’s tests, the confidence interval and Cohen’s d. Levene’s test needs the raw scores, so it is left out. For a paired test from a paper you need the mean and SD of the differences, which are not the same as the two means and SDs.
What does Cohen’s d mean here?
The difference in means divided by a standard deviation, so it says how big the difference is in units of spread rather than in the units of the scale. For two groups it is the pooled SD; for paired data it is the SD of the differences (often written d_z); for one sample, the sample’s SD. Cohen’s labels of 0.2 small, 0.5 medium and 0.8 large were offered as a last resort, not a rule.
Are the numbers right?
Each figure is checked against SciPy, the standard scientific library for Python, on a set of data sets including skewed ones, tiny ones and one whose p-value is about one in a quadrillion: t, degrees of freedom, both kinds of p, the confidence interval, Cohen’s d and Levene’s test. Results match SciPy to at least 6 significant figures in our published checks.
Who can see your file
| Who | Can they see it? |
|---|---|
| You | Yes |
| OBSCURA OS | No. Your file never reaches us. |
| Someone who breaks into our servers | No. Your file is not there. |
| Advertisers or partners | No. |
| Anyone using your unlocked computer, or a harmful browser extension | Yes. Keep your device and browser clean. |
Worked example
The exam scores of two classes of 14 students, one taught online and one in a classroom. Worked out when this page was built, by the same code the calculator runs in your browser:
T-TEST: Two independent groups
n mean SD
Taught online 14 69.14 6.860
Taught in a classroom 14 61.71 6.256
t df p (2-tail) p (1-tail) 95% CI
Student, equal variances 2.994 26 0.0060 0.0030 2.328 to 12.53
Welch, unequal variances 2.994 25.78 0.0060 0.0030 2.326 to 12.53
Levene’s test: F(1, 26) = 0.0934, p = 0.7624
Cohen’s d = 1.13 (pooled SD 6.565); Hedges' g = 1.10
An independent-samples t-test (Welch’s, not assuming equal variances) found
a statistically significant difference between Taught online (M = 69.14, SD
= 6.86, n = 14) and Taught in a classroom (M = 61.71, SD = 6.26, n = 14),
t(25.78) = 2.99, p = .006, d = 1.13. The difference in means was 7.43, 95%
CI [2.33, 12.53].What it does not do
- It does not run Levene’s test from summary figures; it needs the raw scores.
- It does not check that the data meet the test’s assumptions for you; it shows Student’s and Welch’s side by side.
- It does not run tests for more than two groups.
Load this page, turn off Wi-Fi, and run the tool. It still works.