Skip to content
ToolMug

T-Test Calculator

Is the difference between two group means significant? Paste two columns from Excel, or just enter each group's mean, SD and sample size, and get t, the p-value, the confidence interval of the difference and Cohen's d, ready for your report.

Runs in your browser — nothing you enter is uploaded

Numbers separated by spaces, commas or line breaks; columns pasted from Excel work.

t
-1.8608
Degrees of freedom
17.776
p-value
0.0794
Mean difference (1 − 2)
-1.58
Standard error
0.8491
95% confidence interval
-3.3655 … 0.2055
Cohen's d
-0.832

The difference is not statistically significant at α = 0.05.

Results match R’s t.test(). Cohen’s d uses the pooled standard deviation (for paired samples, the SD of the differences).

How to use

  1. Choose one sample, two independent samples or paired samples.
  2. Paste the data, or switch to entering each group's mean, SD and n.
  3. Choose the alternative hypothesis and confidence level; results update instantly.

Options explained

Welch vs Student
Welch's t-test is the default because it doesn't assume equal variances, which is the current recommendation. Untick it for Student's equal-variance test.
Effect size
Cohen's d = mean difference ÷ pooled SD; for paired samples, mean difference ÷ SD of the differences.

A worked example

The default data are the two groups of extra sleep hours from R’s built-in sleep data set (10 values each). With Two independent samples selected:

Result Welch (default) Student (box unticked)
Group means 0.75 and 2.33 0.75 and 2.33
Mean difference (1 − 2) −1.58 −1.58
t −1.861 −1.861
Degrees of freedom 17.776 18
p-value (two-sided) 0.0794 0.0792
95% confidence interval −3.365 … 0.205 −3.364 … 0.204
Cohen’s d −0.832 −0.832

Welch’s standard error is √(s₁²/n₁ + s₂²/n₂), with the Welch–Satterthwaite formula for the degrees of freedom. Student’s uses the pooled variance and n₁ + n₂ − 2 degrees of freedom. Cohen’s d is the same in both because it always uses the pooled SD.

The same numbers become much more significant if you treat them as the same ten people measured twice. Choose Paired samples and the test runs on the ten differences: t = −4.062 with 9 degrees of freedom and p = 0.0028. Pairing removes the variation between people, which is why it can detect a difference that the independent test cannot. Paired data need the same number of values in both boxes, in the same order.

Frequently asked questions

Can I trust the results?

They are checked against R's built-in sleep data set — t, degrees of freedom, p-value and confidence interval all match t.test().

What if my data aren't normal?

With larger samples the t-test is fairly robust. For small, clearly skewed samples consider non-parametric tests such as Mann–Whitney U or Wilcoxon.

Is my data uploaded?

No. Calculations run in your browser.

Privacy

This tool runs entirely in your browser. Your files and text are processed on your device and are never uploaded to our servers.

Related tools