01
How to use the t-test calculator
- Pick the test that matches your design (see the table below).
- Paste each group’s values. A column copied from Excel or Google Sheets works; so do numbers separated by commas or spaces. If you only have published statistics, choose “I have mean, SD and n”.
- Read the result. It updates as you type; there is no button.
- Copy the APA-style line into your results section, and check the plot for outliers before you trust the number.
02
Which t-test to use
| Your data | Test | Degrees of freedom |
|---|---|---|
| Two separate groups (treatment vs control) | Welch’s t-test | Welch–Satterthwaite, usually not a whole number |
| Two separate groups that you know have equal variances | Student’s t-test | n₁ + n₂ − 2 |
| The same subjects measured twice (before vs after) | Paired t-test | number of pairs − 1 |
| One group against a known or target value | One-sample t-test | n − 1 |
The calculator opens on Welch’s test because it stays accurate when the two groups have different variances or sizes, and loses very little when they do not. That is the recommendation of Delacre, Lakens and Leys (2017), and it is what R’s t.test() does unless you ask otherwise.
03
The formulas
Welch’s t-test (Welch, 1947), with M the mean, s the standard deviation and n the size of each group:
t = (M₁ − M₂) ÷ √(s₁²/n₁ + s₂²/n₂)
df = (s₁²/n₁ + s₂²/n₂)² ÷ [ (s₁²/n₁)²/(n₁−1) + (s₂²/n₂)²/(n₂−1) ]
Student’s t-test pools the two variances:
s_p = √( [(n₁−1)s₁² + (n₂−1)s₂²] ÷ (n₁+n₂−2) )
t = (M₁ − M₂) ÷ ( s_p · √(1/n₁ + 1/n₂) ), df = n₁ + n₂ − 2
Paired and one-sample tests work on one column: the differences within each pair, or the sample itself.
t = (M_d − μ₀) ÷ (s_d ÷ √n), df = n − 1
The p value is the two-tailed area of the t distribution beyond ±t. The confidence interval is the difference ± the critical t value times the standard error.
04
Worked example
The calculator opens with this example. Group 1: 5.1, 4.9, 5.6, 5.8, 6.0. Group 2: 4.1, 4.5, 4.3, 4.8, 4.0.
| Group 1 | Group 2 | |
|---|---|---|
| Mean | 5.48 | 4.34 |
| SD | 0.47 | 0.32 |
| n | 5 | 5 |
Welch’s test gives t = 4.51 on 7.10 degrees of freedom, p = .003. The mean difference is 1.14 (95% CI 0.54 to 1.74) and Cohen’s d is 2.85. In a paper: “Group 1 scored higher than group 2, t(7.10) = 4.51, p = .003, d = 2.85.”
05
Cohen’s d: how big the difference is
A p value says whether a difference is likely to be zero; it does not say how large it is. Cohen’s d expresses the difference in standard deviations:
d = (M₁ − M₂) ÷ s_p (paired or one-sample: M_d ÷ s_d)
Cohen (1988) offered 0.2, 0.5 and 0.8 as small, medium and large, as a rough guide when a field has no benchmarks of its own. Report d with the confidence interval of the difference, whatever the p value is.
06
Before you trust the result
- Independent observations. Each value comes from a different subject (or, for a paired test, each pair does). Repeated measurements of one subject are not extra data points.
- Roughly normal data, or enough of it. With small groups, strong skew or outliers distort the test. Look at the dot plot; consider a Mann–Whitney or Wilcoxon test if the data are far from normal.
- Two groups only. Comparing three or more groups with repeated t-tests inflates false positives; use ANOVA.
- Decide the test first. Choose paired or independent from the study design, not from which gives the smaller p value.
07
Your data stays on your computer
All the arithmetic runs in this browser tab. The values are not sent to Sciloom or stored, so unpublished data is safe to paste. When the analysis is done, the figure legend generator helps you state the test, n and error bars under the figure.
08
T-test mistakes that change the answer
- Entering the SEM where the SD belongs. For the worked example the SEMs are 0.21 and 0.14; typed into the SD boxes they raise t from 4.51 to about 10.1, √5 times larger.
- Choosing a one-tailed test after seeing the data. It halves the p value, so a two-tailed p of 0.08 becomes 0.04.
- Running three t-tests instead of an ANOVA. With three pairs of groups the chance of at least one false positive is 1 − 0.95³ = about 14.3%, not 5%, treating the tests as independent.
Trust
How this page is checked
- The calculation runs on code with automated tests against worked reference values. Every number in the examples on this page was produced by that same code, not typed by hand.
- The formulas and conventions used are stated on the page, so you can reproduce the result yourself or compare it with your own software.
- Sources: Delacre, Lakens and Leys (2017), Why psychologists should by default use Welch’s t-test.
- Last reviewed by the Sciloom team, Zebra Nine Studio Inc. It is a tool for research and teaching, not a substitute for a statistician, a validated lab method or medical advice.
Cite this page
Sciloom. (2026). T-test calculator. Zebra Nine Studio Inc. https://sciloom.si/t-test-calculator
Frequently asked questions
How do I calculate a t-test?
Subtract one mean from the other and divide by the standard error of the difference. The calculator does this from your raw values or from each group’s mean, SD and n, then finds the p value from the t distribution.
What p value is significant?
By convention, p below 0.05 is called statistically significant, which matches the 95% confidence level. Choose 99% in the calculator to test at 0.01.
Should I use Welch’s or Student’s t-test?
Use Welch’s unless you have a specific reason to assume equal variances. It gives nearly the same answer when variances are equal and a more accurate one when they are not.
Is the p value one-tailed or two-tailed?
Two-tailed by default. If you predicted the direction before seeing the data, choose a one-tailed alternative in the calculator; it reports the one-tailed p value and marks it in the result sentence.
Can I run a t-test from mean and standard deviation only?
Yes, for two independent groups: choose “I have mean, SD and n” and enter the three numbers for each group. If a paper reports standard errors instead, tick the SEM box. A paired test needs the raw pairs.