Calculators
Home › Calculators › T Test

T Test Calculator

One page, all three t-tests: pick the one that matches your data.

Published 11 November 2026

Run a t-test

Choose the test that matches your data, then paste it in.

Quick answer: Pick your test, paste the data. The bakery batch: t(7) = 2.68, p = 0.0316 against a claimed mean of 40, with a large effect (d = 0.95). Two classes: t(11.3) = 4.48, p = 0.0009. Before and after: t(7) = 5.81, p = 0.0007.

Three t-tests, one question each

Open any stats package and you will find three t-tests sitting side by side, and the software will not tell you which one you need. Pick wrong and the numbers still come out. They just answer a question you never asked. The choice takes ten seconds once you know what to look for: how many groups you have, and whether the same people show up twice.

Your dataThe testWhat it asks
One group, one claimed valueOne-sampleIs this mean different from μ₀?
Two separate groupsTwo-sampleDo these two means differ?
Same subjects, measured twicePairedDid the average change?

That is the whole decision. Count the groups. Then check whether the rows are linked. Two classes of different students: two-sample. The same eight students before and after a revision week: paired, because each student is their own control. One batch of daily sales against the 40-a-day the owner believes in: one-sample.

The three worked examples, side by side

Worked example: one-sample

A bakery believes it sells 40 cakes a day. Eight days of records: 42, 38, 45, 51, 44, 39, 47, 50. Mean 44.5, s = 4.7509, standard error 1.6797. t = (44.5 − 40) ÷ 1.6797 = 2.679 on 7 df, two-tailed p = 0.0316. The 95% interval for the mean (40.53 to 48.47) clears 40 entirely. Cohen's d = 0.947, a large standardised difference. The dedicated one-sample t-test calculator runs this same test with full steps, the interval and the effect size.

Worked example: two-sample

Two classes take the same quiz. Class 1: 78, 82, 85, 90, 88, 84, 79, 91 (mean 84.625). Class 2: 72, 75, 80, 77, 74, 79, 73, 76 (mean 75.75). Welch's t = 4.484 on about 11.3 df, two-tailed p = 0.0009, and the 95% interval for the gap runs 4.53 to 13.22 marks. Cohen's d ≈ 2.2. The gap is real, and it is big enough to matter in a classroom.

Worked example: paired

Eight students, a quiz before and after a revision week. Differences (after − before): 6, 7, 5, 13, 14, 5, 6, 15. Mean gain 8.875 marks, SD of the differences 4.3239. t = 5.805 on 7 df, two-tailed p = 0.0007, and the 95% interval for the gain (5.26 to 12.49) sits well clear of zero. Pairing did the heavy lifting here: the raw scores sprawled from the low 70s to 91, while the differences stayed steady.

Reading the output, in order

Start with the interval, not the p-value. It says how big the difference plausibly is, in the units you care about: cakes a day, marks, points. Then the p-value: how surprising the data would be if the null were true. Then Cohen's d: the same difference measured in standard deviations, so you can compare it with other studies. The t statistic itself is the machinery between them: the observed difference divided by its standard error. Report all four and the reader never has to guess what you found.

Assumptions that actually matter

Watch out

Running all three tests on the same data and reporting the smallest p-value. That is test shopping, and it quietly multiplies your false-positive rate. Choose the test from the design, before you see any output. The design tells you which one fits; the p-value never does.

Frequently asked questions

Which t-test do I need?

Count the groups, then check for links. One group against a claimed value: one-sample. Two separate groups: two-sample. The same subjects measured twice: paired. If you are still unsure, the table at the top of this page settles it.

Welch or pooled for the two-sample test?

Welch is the safer default: it lets each group keep its own variance. Pooled assumes one shared variance, which is exactly the kind of thing that is false precisely when you cannot check it well. Use pooled only when a course rubric demands it.

Why is my degrees of freedom a decimal?

That is Welch's doing. The Welch-Satterthwaite formula gives fractional df, and it is correct: report it as computed, for example t(11.3) = 4.48.

t-test or z-test?

Use the z-test only when the population standard deviation is genuinely known from outside your sample, such as a calibrated process or a standardised test's design. If the SD came from the sample itself, the t-test is the honest choice.