Paired T-Test Calculator
Paste two matched columns, such as each person before and after…
Paste two matched columns, such as each person before and after, to test the average change with a paired t-test, every pair drawn as a line.
Read 12 values; left out the header row (“Before”).
Read 12 values; left out the header row (“After”).
More optionsTwo-sided, 95% confidence
The significance level is 1 − the confidence level (0.05 at 95%).
ExampleP-value
5.64 × 10⁻⁶
On average After is 3 lower than Before (difference −3, 95% CI −3.813 to −2.187). Significant at the 5% level (p < 0.05).
Paste your own numbers to test them.
Each line joins one pair, from before to after; the diamonds are the means.
The distribution the statistic follows if there were no difference; the shaded area beyond it is the p-value.
- t, df
- −8.124, 11
- Effect size dz (Hedges g)
- −2.345 (−2.181)
- Pairs up · down · same
- 0 · 12 · 0
How this works: 9 sources,
How this works
Method
A paired t-test is for two measurements of the same things: each person before and after a programme, each plot of land with two fertilisers, each machine on two settings. Instead of comparing two groups, it works out the difference within every pair and asks whether the average difference is zero. In the example, twelve runners’ resting heart rates fell by 3 beats per minute on average after eight weeks, and every one of them went down. Full method
Sources
- Wikipedia, Paired difference test
- NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.5.2 Confidence Limits for the Mean
- NIST/SEMATECH e-Handbook of Statistical Methods
- Abramowitz and Stegun, Handbook of Mathematical Functions, chapters 6, 7 and 26 (1964)
- SciPy 1.18 scipy.stats (reference values for the tests)
- statsmodels 0.15 (reference values for the A/B test and regression intervals)
- Welch, The generalization of Student’s problem when several different population variances are involved (Biometrika) (1947)
- Fleiss, Levin and Paik, Statistical Methods for Rates and Proportions, 3rd edition (sample size for two proportions) (2003)
- Hyndman and Fan, Sample quantiles in statistical packages (The American Statistician) (1996)
How it’s tested
2 worked examples for this page are checked by automated tests before every release: given the inputs, the tool must show the expected answer.
Privacy
On your device. Nothing you enter or open leaves this browser. About privacy labels
Changes
- First published: live curves with draggable cut-offs, and tests on pasted data (t-tests, ANOVA, chi-square, Fisher’s exact, correlation, regression, A/B), checked against SciPy.
How the paired t-test works
A paired t-test is for two measurements of the same things: each person before and after a programme, each plot of land with two fertilisers, each machine on two settings. Instead of comparing two groups, it works out the difference within every pair and asks whether the average difference is zero. In the example, twelve runners’ resting heart rates fell by 3 beats per minute on average after eight weeks, and every one of them went down.
Pairing removes the large differences between people, which would otherwise swamp the change. Their resting rates range from 60 to 92, so run the same numbers through a two-sample test and the p-value is about 0.41, nothing to see; paired, it is about 0.000006, because everyone’s own baseline cancels out. The flip side: the pairs must really belong together, in the same order in both columns.
The test is a one-sample t-test on the differences: t = mean difference ÷ (SD of differences ÷ √n), with n − 1 degrees of freedom. The effect size here is dz, the mean difference in standard deviations of the differences. It runs larger than Cohen’s d for independent groups on the same data, so don’t compare the two directly.
dᵢ = afterᵢ − beforeᵢ · t = d̄ ÷ (s_d ÷ √n), df = n − 1
- A paired difference test reduces the variation from differences between subjects by comparing each subject with itself. Source: Wikipedia, Paired difference test.
- The paired t-test is a one-sample t-test applied to the paired differences, so its confidence interval is the mean difference ± t* × s_d/√n. Source: NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.5.2 Confidence Limits for the Mean.
The smallest average change a paired test can detect
When the differences have a standard deviation of 5: the mean change needed for a two-sided p-value under 0.05, by the number of pairs (t* × 5 ÷ √n).
| Pairs | df | t* (5%) | Mean change needed |
|---|---|---|---|
| 3 | 2 | 4.303 | ±12.421 |
| 4 | 3 | 3.182 | ±7.956 |
| 5 | 4 | 2.776 | ±6.208 |
| 6 | 5 | 2.571 | ±5.247 |
| 8 | 7 | 2.365 | ±4.18 |
| 10 | 9 | 2.262 | ±3.577 |
| 12 | 11 | 2.201 | ±3.177 |
| 15 | 14 | 2.145 | ±2.769 |
| 20 | 19 | 2.093 | ±2.34 |
| 30 | 29 | 2.045 | ±1.867 |
Show all 13 rowsShow fewer
| 50 | 49 | 2.01 | ±1.421 |
| 100 | 99 | 1.984 | ±0.992 |
| 200 | 199 | 1.972 | ±0.697 |
Common questions
When is data paired?
When every value in one column has a natural partner in the other: the same person measured twice, twins, left and right eyes, matched patients, or the same product tested two ways. If the two columns are just two separate groups that happen to be the same size, use the two-sample t-test.
What if some people are missing an “after” value?
They can’t be used in a paired test. Paste the two columns together and rows with only one value are left out (the page says how many), keeping the pairs aligned.
Does the order of the columns matter?
Only for the sign. The difference is the second column minus the first, so a drop shows as a negative mean difference; the p-value is the same either way for a two-sided test.