Paired t-Test screenshot

Paired t-Test

Compare two measurements of the same units: mean difference, t, degrees of freedom and a two-tailed p.

Privacy First
0 Runs
Updated 2026-11-06
No upload
Runs in this tab
No signup

What this page computes

Type the before and after values as two comma-separated lists of equal length. The page takes the differences d = after − before, prints them, and runs a one-sample t test on them: t = d̄/(s_d/√n) on n − 1 degrees of freedom, with s_d from the n − 1 divisor. The p-value is two-tailed for the hypothesis that the mean difference is zero, and the direction is stated because the sign is part of the answer. Figures print to six significant figures.

The test needs pairs: each after value belongs to the before value in the same position. A length mismatch is refused with both counts, and so is a set of differences with zero spread, which would divide by zero.

Both lists are read in the browser only, so the same pairs print the same t and p after any reload.

The page tests paired measurements by taking the difference after − before on each pair and running a one-sample t on those differences: t = d̄/(s_d/√n) with n − 1 degrees of freedom and a two-tailed p. Eight pairs changing by 1, 1, 0, 1, 1, 1, 1, 1 give a mean difference of 0.875, s_d of 0.353553, t = 7 on 7 degrees of freedom and p = 0.000211555. The sign of the difference is printed because it is half the answer, and the differences themselves are listed.

Test paired before-and-after measurements with a two-tailed t on the differences.

How to use it

Type the before values as a comma-separated list and the after values the same way; the lists must be the same length, and a mismatch is refused with both counts named. Pairs are read position by position, so the third before belongs with the third after. At least two pairs are needed, and a constant difference is refused because its standard deviation is zero.

The sign, the pairing and the degrees of freedom

The difference is defined as after − before and the page states that, because reversing it flips the sign of t and turns an increase into a decrease. This is not the same test as an unpaired two-sample test: pairing removes the between-subject variation, which is why the same numbers analysed as two independent groups usually give a much smaller t. The p-value is two-tailed against the mean difference being zero, and the degrees of freedom are n − 1 pairs.

What to Expect

Best for

  • Before-and-after measurements on the same subjects

What this tool keeps

  • Nothing leaves this tab: the arithmetic runs in the page you are reading, and a reload discards both the input and the result.

Sample output

mean difference (after − before) = 0.875, s_d = 0.353553 t = 7, df = 7, p = 0.000211555 (two-tailed, H₁: the mean difference ≠ 0) n = 8 pairs, SE of the difference = 0.125 differences: 1, 1, 0, 1, 1, 1, 1, 1

Frequently asked questions

Is the difference after − before or before − after?

After minus before, stated on the result line. Reversing it would flip the sign of t and turn an increase into a decrease, so the direction is printed with the mean difference and the individual differences are listed.

What tail is the p-value, and what are the degrees of freedom?

Two-tailed, testing that the mean difference is zero, with n − 1 degrees of freedom for n pairs — eight pairs give df = 7, printed on the result line.

Is my data uploaded?

No. The differences and the test are computed in this page from the two lists you typed, and nothing is posted to a server or stored.

Developer program

Build custom tools for your store

Join the SDK program to create useful ecommerce utilities for your store.