Paired Samples t-Test Calculator

StatisticsLast updated: August 22, 2026

The paired (dependent samples) t-test compares measurements taken from the same individuals at two different times or under two different conditions. Before and after an intervention, the readings of two instruments on the same specimens, or matched case-control pairs are typical uses.

The test is really a one-sample t-test run on the difference scores: a difference is taken for each pair, and the mean of those differences is tested against zero. The calculator returns the mean and standard deviation of the differences, t and its degrees of freedom, the p-value, the confidence interval for the difference, and Cohen's d; it also builds the difference table, a histogram of the differences, and a Q-Q plot for checking the normality assumption.

The first measurement of each participant. The order must match the second measurement exactly.
The second measurement of the same participants; it must contain as many values as the first.
Sets the sign of the difference, and with it the sign of t.
Choose a directional hypothesis only if the direction of the difference can be justified in advance.
Sets the false-positive risk. In the social sciences 5% is the usual choice.
The probability that the interval covers the true parameter.

Paired Samples t-Test Formulas

Difference score:  dᵢ = xᵢ(after) − xᵢ(before)
Hypotheses:        H₀: μ_d = 0   ·   H₁: μ_d ≠ 0
Mean difference:   d̄ = Σdᵢ / n
SD of differences: s_d = √[ Σ(dᵢ − d̄)² / (n − 1) ]
Standard error:    SE = s_d / √n
Test statistic:    t = d̄ / SE,   df = n − 1
Confidence int.:   d̄ ± t₍₁−α/₂; n−1₎ · SE
Effect size:       d = d̄ / s_d

The degrees of freedom come from the number of pairs (n − 1), not from the total number of observations. Normality is required of the difference scores; the raw measurements do not have to be normal.

How to Calculate

  1. Paste the first measurements (before) and the second measurements (after) into separate boxes, in the same participant order.
  2. Make sure both lists hold the same number of values; pairs with missing data must be removed from the analysis.
  3. Choose how the difference is defined: to treat an increase as positive, stay with "After − Before".
  4. Set the hypothesis direction, the significance level (α), and the confidence level.
  5. Check the normality assumption for the difference scores using the Q-Q plot and the normality warning.
  6. Report the mean difference, t and p, the confidence interval, and Cohen's d together; use the difference table to spot participants with extreme change.

Worked Examples

Before and after a training program

The mean of 10 participants rose from 71.50 to 76.00; the mean difference is 4.50 points with a standard deviation of 2.01. With t = 7.066 and df = 9, p < 0.001 and H₀ is rejected. The 95% confidence interval for the difference runs from 3.06 to 5.94; Cohen's d = 2.235 points to a very large effect, and the correlation between the measurements is r = 0.831.

t statistic: 7.0662 · Degrees of freedom (df): 9 · p-value: p < 0.001

A measurement with no significant change

Across 8 pairs the differences are 2, −2, 2, −2, 1, 2, −2, and −1, so the mean difference is exactly 0 and the standard deviation of the differences is 1.93. With t = 0.000 and df = 7, p = 1.000 and H₀ cannot be rejected. Because the 95% confidence interval for the difference runs from −1.61 to 1.61, no real change can be claimed.

t statistic: 0.0000 · Degrees of freedom (df): 7 · p-value: p = 1.000

A one-tailed test of a decrease

With the difference defined as "Before − After", the blood pressure readings show a mean drop of 7.30 mmHg (from 148.80 to 141.50) with a standard deviation of 2.16. In the right-tailed test, t = 10.673 with df = 9 gives p < 0.001. The 95% confidence interval for the drop runs from 5.75 to 8.85 mmHg, and Cohen's d = 3.375 is a very large effect.

t statistic: 10.6734 · Degrees of freedom (df): 9 · p-value: p < 0.001

Frequently Asked Questions

What is the difference between a paired and an independent samples t-test?
The independent samples test compares two separate groups, while the paired test compares two measurements of the same individuals. Because the paired design removes individual differences from the analysis, it is usually the more powerful of the two: it can detect the same effect with a smaller sample. Running an independent test on paired data violates the independence assumption and gives a wrong p-value.
Which variable has to be normally distributed?
Only the difference scores. The before and after measurements do not have to be normal on their own; what matters is that the series dᵢ = after − before is approximately normal. That is why the calculator applies the Q-Q plot and the Shapiro-Wilk check to the differences rather than to the raw measurements.
What should I do if the difference scores are not normal?
The Wilcoxon signed-rank test is the nonparametric counterpart of the paired design and works on the ranks of the differences. In very small samples the sign test is another option, though it has less power. Alternatively, a transformation such as a logarithm can make the distribution of the differences symmetric; remember that the interpretation then changes scale.
Why are the degrees of freedom n − 1?
The test is really a one-sample t-test on n difference scores, so the degrees of freedom are one less than the number of pairs. Even though there are 2n measurements in total, only n units carry independent information. With before and after measurements from 20 people, df = 19, not 39.
How is Cohen's d computed here?
This calculator reports d = d̄ / s_d, the mean of the differences divided by their standard deviation, which matches the effect size in the SPSS paired samples t-test output. The literature also contains versions that use the average standard deviation of the raw measurements, and those usually produce a smaller value. State which definition you used in your report.
What should I do if some participants are missing a second measurement?
A paired test can only use pairs that are complete on both measurements; an incomplete pair is dropped from the analysis entirely. That is why the two boxes must hold the same number of values. If a lot of data is missing, the result may be biased; consider whether the loss is random.
How do I get the same result in SPSS, Excel, and R?
In SPSS, Analyze → Compare Means → Paired-Samples T Test gives the same t, df, and Sig. (2-tailed) values. In Excel, the formula T.TEST(array1, array2, 2, 1) returns the two-tailed paired p-value. In R, t.test(after, before, paired = TRUE) reproduces the output here.