T-test calculator

This t-test calculator compares two means and tells you whether the difference is statistically significant. Paste your two groups, or enter the mean, standard deviation and sample size, and read t, the degrees of freedom, the two-tailed p value, the confidence interval and Cohen’s d, with a sentence ready to paste into your results.

Your numbers are calculated in your browser and are not sent or stored.

Different participants in each group. Does not assume equal variances. The safe default.

The numbers stay in your browser; nothing is uploaded.

The difference is statistically significant at the .05 level (p = .003).

t
4.506
Degrees of freedom
7.10
p (two-tailed)
0.0027
Mean difference
1.140 (95% CI 0.543 to 1.737)
Standard error
0.253
Cohen’s d
2.85
Group 1
M = 5.48, SD = 0.47, n = 5
Group 2
M = 4.34, SD = 0.32, n = 5

To report (APA style)

t(7.10) = 4.51, p = .003, d = 2.85, 95% CI [0.54, 1.74]

4.05.06.0Group 1Group 2
Check your result: the 95% confidence interval of the difference leaves out 0 exactly when the two-tailed p is below 0.05: in the worked example it runs from 0.54 to 1.74, with p = .003. And t is the difference divided by its standard error: 1.14 ÷ 0.253 = 4.51.
t for the worked example, Welch
4.51
t for the worked example, Welch
two-tailed p for the same data
.003
two-tailed p for the same data
Cohen’s d
2.85
Cohen’s d
t-tests: Welch, Student, paired, one-sample
4
t-tests: Welch, Student, paired, one-sample
  • Welch, Student, paired, one-sample; one- or two-tailed
  • Raw data, or mean with SD or SEM
  • p value, CI and Cohen’s d
  • APA-style result sentence
  • Runs in your browser, free

01

How to use the t-test calculator

  1. Pick the test that matches your design (see the table below).
  2. 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”.
  3. Read the result. It updates as you type; there is no button.
  4. Copy the APA-style line into your results section, and check the plot for outliers before you trust the number.
−1.960+1.962.5%2.5%95%test statistic (z or t)
What a two-tailed p value measures. The curve is what the test statistic would look like if there were no real effect. The p value is the shaded area: the chance of a result at least as far from the centre as yours, in either direction. Here the cut-offs sit at ±1.96, which leaves 5% in the two tails together.

02

Which t-test to use

Your dataTestDegrees of freedom
Two separate groups (treatment vs control)Welch’s t-testWelch–Satterthwaite, usually not a whole number
Two separate groups that you know have equal variancesStudent’s t-testn₁ + n₂ − 2
The same subjects measured twice (before vs after)Paired t-testnumber of pairs − 1
One group against a known or target valueOne-sample t-testn − 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 1Group 2
Mean5.484.34
SD0.470.32
n55

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

Read the full methodology · Who makes Sciloom

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.

Result in hand? Put it in a figure legend, or summarise the whole study as a graphical abstract.
Free to start, no sign-up.
Back to the tool ↑

More research tools