Skip to content
Statculator
Hypothesis Tests

Paired t-Test Calculator

Free paired t test calculator: paste before-and-after data or enter d̄, s_d and n to get t, df, the p-value and the decision, with the formula and every step.

Free, no sign-up Runs in your browserBy Hira Noor, BS MathematicsUpdated

Try

μ_d is the population mean of d = Before − After. Right-tailed means you expect Before to be larger (values went down).

Usually 0.05 or 0.01.

Data input
Paired observations
#BeforeAfterRemove row
1
2
3
4
5
6
7
8
9
10
Tip: paste rows straight from a spreadsheet.

One row per subject. Any matched pair works: before/after, left/right, twin A/twin B. The difference is d = Before − After.

Differences are Before − After, so a positive d̄ means values decreased. The test assumes the differences are roughly normal.

Results

t statistic
5.0747
p-value
0.0007
Two-tailed, df = 9

Reject H₀ at α = 0.05

p = 0.0007 ≤ 0.05. At the 5% level there is sufficient evidence that the mean of Before − After is not zero (the paired values differ on average).

Mean difference, d̄
3.4
SD of differences, s_d
2.1187
Number of pairs, n
10
Standard error, s_d / √n
0.67
Degrees of freedom
9
Critical t (α = 0.05)
±2.2622
Cohen’s d_z
1.6048 (large)
95% CI for μ_d
(1.8844, 4.9156)
Mean Before
75.8
Mean After
72.4

Interpretation: On average Before − After = 3.4 (values went down), which is 5.0747 standard errors from zero. A mean change this large would be unlikely if there were no real change.

  • With only 10 pairs the test depends on the differences being roughly normal. Look for outliers in the d column before trusting the p-value.
t distribution curve with the shaded probability region, markers at t = 5.075t = 5.075-4-3-2-1012345t distribution, df = 9
Shaded area: rejection region at the chosen α. Dashed line: your test statistic.

Differences table

#BeforeAfterd = Before − After(d − d̄)²
1726840.36
2787440.36
36970-119.36
4817566.76
5757230.16
6706730.16
7847952.56
8777521.96
9737121.96
10797366.76
Σ7587243440.4

Step-by-step solution

  1. 1

    State the hypotheses

    This is a two-tailed test.

    H₀: μ_d = 0
    H₁: μ_d ≠ 0
  2. 2

    Choose the significance level

    α = 0.05
  3. 3

    Find each difference d = Before − After

    The paired test analyses the differences only, so the two columns collapse into one sample.

    d₁ = 72 − 68 = 4
    d₂ = 78 − 74 = 4
    d₃ = 69 − 70 = -1
    d₄ = 81 − 75 = 6
    …
  4. 4

    Find the mean and SD of the differences

    d̄ = Σd / n = 34 / 10 = 3.4
    s_d = √[Σ(d − d̄)² / (n − 1)] = 2.1187
  5. 5

    Find the standard error of d̄

    SE = s_d / √n = 2.1187 / √10 = 0.67
  6. 6

    Calculate the test statistic

    t = (d̄ − 0) / SE = 3.4 / 0.67 = 5.0747
  7. 7

    Find the p-value

    Use the t distribution with df = n − 1 = 10 − 1 = 9, where n is the number of pairs.

    p = 2 × P(t ≥ |5.0747|) = 0.0007
  8. 8

    Find the critical value

    Critical value: ±2.2622
    Reject H₀ if |t| ≥ 2.2622
  9. 9

    Decision: reject H₀

    At the 5% level there is sufficient evidence that the mean of Before − After is not zero (the paired values differ on average).

    p = 0.0007 ≤ α = 0.05
  10. 10

    Effect size and confidence interval

    d_z = d̄ / s_d = 3.4 / 2.1187 = 1.6048
    95% CI for μ_d = 3.4 ± 2.2622 × 0.67 = (1.8844, 4.9156)

What is a Paired t-Test Calculator?

A paired t-test (dependent samples t-test) checks whether the mean difference between two matched measurements is zero. Compute d = Before − After for every pair, then run a one-sample t-test on those differences: the paired t test formula is t = d̄ / (s_d / √n) with df = n − 1, where n is the number of pairs. Example: ten adults whose resting heart rate dropped by an average of d̄ = 3.4 bpm (s_d = 2.1187) give t = 5.07, df = 9 and a two-tailed p = 0.00067, so the change is significant at α = 0.05.

What the Paired t-Test Calculator does

This free paired t test calculator takes two columns of matched data, or just the mean and standard deviation of the differences, and returns the paired t statistic, degrees of freedom, p-value, critical value and a reject or fail-to-reject decision for a two-tailed, left-tailed or right-tailed test. With raw data it builds a differences table (each d and its squared deviation) and shows every step of calculating the paired t test with your numbers. It also reports Cohen’s d_z and a 95% confidence interval for the mean difference, and draws the t distribution with the rejection region shaded.

It works as a paired difference t test calculator, a dependent samples t test calculator or a t test calculator for paired samples: the names all describe the same test. Paired or independent? Use this page when every value in one column belongs with exactly one value in the other: the same people before and after a programme, the same parts measured by two gauges, or twins and matched case-control pairs. If the two columns come from different people, the samples are independent: use the Independent Samples t-Test Calculator (or the Welch’s t-test when the spreads differ). Not sure which test you need? The T-Test Calculator covers all three designs in one place.

How to use the Paired t-Test Calculator

  1. Choose the alternative hypothesis for μ_d, the population mean of Before − After. Two-tailed (≠) is the default; right-tailed means you expect a decrease, left-tailed means you expect an increase.
  2. Set the significance level α, usually 0.05.
  3. Under Paired data, type or paste one row per subject with the Before and After values (paste two columns straight from Excel or Google Sheets). If you only have the mean and SD of the differences, choose Summary of differences and enter d̄, s_d and the number of pairs n.
  4. Read t, df and the p-value, then check the differences table and open the step-by-step solution. The three example buttons above the calculator load the worked examples on this page.

What is a paired sample t-test?

A paired sample t-test (also called a dependent t-test, matched pairs t-test or repeated measures t-test) compares two means that come from the same subjects or matched units. Instead of comparing the two column means directly, it works on one column of differences, so each subject acts as their own control. The hypotheses are H₀: μ_d = 0 (no mean change) against H₁: μ_d ≠ 0, μ_d < 0 or μ_d > 0.

Because the variation between subjects cancels out in each difference, the paired difference t test is usually far more sensitive than a test on two separate groups. On the heart-rate data below, the paired test gives p = 0.00067, while an unpaired t-test on the same 20 numbers gives t = 1.78 and p = 0.093 and misses the effect: the Before and After columns are strongly correlated (r = 0.92), and only the paired test uses that.

How to calculate a paired t-test by hand

Calculating a paired t test takes seven steps, the same ones the calculator shows:

  1. State the hypotheses: H₀: μ_d = 0 and H₁: μ_d ≠ 0 (or < 0, or > 0), and choose α.
  2. Subtract each pair: dᵢ = Beforeᵢ − Afterᵢ. Keep the sign.
  3. Find the mean difference: d̄ = Σd / n, where n is the number of pairs.
  4. Find the standard deviation of the differences: s_d = √[Σ(d − d̄)² / (n − 1)].
  5. Find the standard error: SE = s_d / √n.
  6. Calculate the test statistic: t = d̄ / SE, with df = n − 1.
  7. Get the p-value from the t distribution (the P-Value from t Calculator does this) or compare t with the critical value from the t-table. Reject H₀ if p ≤ α.

Paired t-test formula

The paired t test formula turns two matched columns into one column of differences and then tests whether their mean is zero. The paired t test statistic is the mean difference divided by its standard error.

Differences
dᵢ = Beforeᵢ − Afterᵢ
Mean and SD of the differences
d̄ = Σd / n; s_d = √[Σ(d − d̄)² / (n − 1)]
Test statistic
t = d̄ / (s_d / √n)
Degrees of freedom
df = n − 1
Effect size
d_z = d̄ / s_d
Confidence interval for μ_d
d̄ ± t* · s_d / √n
Formula symbols
SymbolMeaning
d̄mean of the differences
s_dstandard deviation of the differences (n − 1 divisor)
nnumber of pairs, not the total number of measurements
μ_dpopulation mean difference; H₀ says μ_d = 0
t*critical t value with n − 1 degrees of freedom

Swapping the columns (After − Before) flips the sign of d̄ and t but leaves the two-tailed p-value unchanged. For a one-tailed test, make sure the direction of H₁ matches how the difference is defined.

If you only know each column’s SD and the correlation r between them, the SD of the differences is s_d = √(s₁² + s₂² − 2r·s₁·s₂).

Paired t-test example

Worked example 1: resting heart rate before and after training

Problem. Ten adults have their resting heart rate (bpm) measured before and after eight weeks of training: Before = 72, 78, 69, 81, 75, 70, 84, 77, 73, 79; After = 68, 74, 70, 75, 72, 67, 79, 75, 71, 73. Did heart rate change, at α = 0.05? These are the calculator’s default inputs.

  1. 01Differences (Before − After): 4, 4, −1, 6, 3, 3, 5, 2, 2, 6. Σd = 34, so d̄ = 3.4.
  2. 02Σ(d − d̄)² = 40.4, so s_d = √(40.4 / 9) = 2.1187.
  3. 03SE = 2.1187 / √10 = 0.6700; t = 3.4 / 0.6700 = 5.0747 with df = 9.
  4. 04Two-tailed p-value = 2 · P(T₉ ≥ 5.0747) ≈ 0.00067; critical value ±2.2622.
  5. 05d_z = 3.4 / 2.1187 = 1.6048; 95% CI for μ_d = (1.8844, 4.9156) bpm.

Answer. p < 0.001, so reject H₀. Resting heart rate fell by about 3.4 bpm on average, and the whole confidence interval is above zero.

How to interpret paired t-test results

  • The sign of d̄ and t gives the direction. With d = Before − After, a positive d̄ means values went down and a negative d̄ means they went up.
  • The p-value is the probability of a mean difference at least this far from zero if there were truly no change. p ≤ α means reject H₀; p > α means the data are consistent with no change, not that the change is exactly zero.
  • The 95% confidence interval for μ_d gives the plausible size of the average change. If it excludes 0, the two-tailed test at α = 0.05 rejects H₀. For the interval on its own, with any confidence level, use the Paired t-Test Confidence Interval Calculator.
  • Cohen’s d_z = d̄ / s_d measures the size of the change in units of the difference SD. Rough benchmarks: 0.2 small, 0.5 medium, 0.8 large. A tiny change can be significant with many pairs, so report the effect size and the interval, not only the p-value.
  • Report it as, for example: “Resting heart rate fell from 75.8 to 72.4 bpm, t(9) = 5.07, p < 0.001, mean difference 3.4 bpm, 95% CI 1.88 to 4.92, d_z = 1.60.”

Worked example 2: a one-tailed paired t-test (exam scores)

Eight students sit a practice exam before and after a revision course. Before = 62, 70, 58, 75, 66, 71, 64, 69; After = 65, 74, 57, 80, 70, 73, 69, 70. The course was expected to raise scores, so with d = Before − After the alternative is H₁: μ_d < 0 (left-tailed), at α = 0.05. Click the Exam scores example to load the data.

  1. Differences: −3, −4, 1, −5, −4, −2, −5, −1. Σd = −23, so d̄ = −2.875.
  2. Σ(d − d̄)² = 30.875, so s_d = √(30.875 / 7) = 2.1002.
  3. SE = 2.1002 / √8 = 0.7425; t = −2.875 / 0.7425 = −3.8719 with df = 7.
  4. Left-tailed p = P(T₇ ≤ −3.8719) = 0.0031; the critical value is −1.8946, and t is beyond it.
  5. Reject H₀: scores rose by about 2.9 points on average. 95% CI for μ_d: (−4.6308, −1.1192); d_z = −1.37.

Worked example 3: paired t-test from the mean and SD of the differences

Papers often report only the summary of the differences. Suppose 18 patients show a mean drop of d̄ = 2.6 units with s_d = 4.1. Choose Summary of differences (or click the Summary example) and test H₀: μ_d = 0 two-tailed at α = 0.05.

  1. SE = 4.1 / √18 = 0.9664.
  2. t = 2.6 / 0.9664 = 2.6905 with df = 17.
  3. Two-tailed p = 0.0155; critical values ±2.1098.
  4. Reject H₀. 95% CI for μ_d: (0.5611, 4.6389); d_z = 0.63, a medium effect.

Paired t-test critical values (df = n − 1)

The degrees of freedom for a paired t test are the number of pairs minus one. Reject H₀ in a two-tailed test when |t| is at least the critical value; in a one-tailed test, when t is beyond the one-tailed value in the direction of H₁. Other values are in the T Critical Value Calculator.

Critical values of t for common pair counts
Pairs ndfOne-tailed α = 0.05Two-tailed α = 0.05Two-tailed α = 0.01
542.13182.77644.6041
652.01502.57064.0321
1091.83312.26223.2498
15141.76132.14482.9768
20191.72912.09302.8609
30291.69912.04522.7564
50491.67662.00962.6800
100991.66041.98422.6264

Paired t-test vs unpaired t-test

The choice depends on how the data were collected, not on the result you want. If you can draw a line from each value in one column to exactly one value in the other, the data are paired. To calculate an unpaired t-test, compare the two group means with the Independent Samples t-Test Calculator, which uses both group SDs and n₁ + n₂ − 2 degrees of freedom (or the Welch df).

Paired and unpaired (independent) t-tests compared
Paired t-testUnpaired t-test
DataSame subjects measured twice, or matched pairsTwo separate groups of subjects
What is analysedOne column of differences dTwo group means x̄₁ and x̄₂
Test statistict = d̄ / (s_d / √n)t = (x̄₁ − x̄₂) / SE of the difference
Degrees of freedomn − 1 (n = pairs)n₁ + n₂ − 2, or the Welch df
Group sizesMust be equal (one row per pair)Can differ
Heart-rate data on this paget = 5.07, p = 0.00067t = 1.78, p = 0.093

Paired t-test in Excel, R, Python and the TI-84

All four use the same paired t-test equation as this calculator, so t and the p-value should match to rounding. For a longer explanation with diagrams, read the paired t-test guide.

  • Excel: =T.TEST(before_range, after_range, 2, 1) returns the two-tailed p-value; the last argument 1 selects the paired test. Use 1 instead of the first 2 for a one-tailed p.
  • R: t.test(before, after, paired = TRUE) prints t, df, the p-value and the 95% CI.
  • Python: from scipy.stats import ttest_rel, then ttest_rel(before, after); add alternative="less" or "greater" for one-tailed tests.
  • TI-84: enter Before in L1 and After in L2, then on the home screen type L1 − L2 → L3. Go to STAT → TESTS → 2:T-Test, choose Data, set μ₀ = 0, List = L3, Freq = 1, pick the alternative and Calculate.

Sources

The formulas, critical values and software notes on this page follow these references:

Common use cases

  • Before-and-after studies: blood pressure, weight, test scores or reaction times measured on the same subjects.
  • Method comparison: two instruments, raters or methods applied to the same items.
  • Crossover trials, where each participant receives both treatments.
  • Matched designs such as twins, siblings or case-control pairs matched on age and sex.

Assumptions and limitations

  • Pairs must be genuine: each Before value must belong to the After value in the same row. If the groups are separate people, use the Independent Samples t-Test Calculator or Welch’s t-Test Calculator.
  • Normal differences: only the differences need to be roughly normal, not the raw columns. With fewer than about 15 pairs check the differences for outliers; for skewed differences use the Wilcoxon signed-rank test.
  • Independent pairs: each row must be a different subject or matched unit, with no pair influencing another.
  • No control group: a before-after design cannot separate the treatment effect from time trends or regression to the mean.

Frequently asked questions

How do you calculate a paired t-test?

Subtract each pair (d = Before − After), find the mean d̄ and standard deviation s_d of the differences, then compute t = d̄ / (s_d / √n) with n − 1 degrees of freedom, where n is the number of pairs. Read the p-value from the t distribution and reject H₀ if p ≤ α. For d̄ = 3.4, s_d = 2.1187 and n = 10, t = 5.07 and p = 0.00067.

What is a paired sample t-test?

It is a test of whether the average difference between two related measurements is zero, such as the same people measured before and after a treatment. It reduces each pair to one difference and runs a one-sample t-test on those differences.

Can I calculate a paired t-test online?

Yes. Paste the two matched columns into the calculator above, or enter the mean and SD of the differences, and it returns t, df, the p-value, the critical value and the decision, with the full working. Nothing is uploaded; the calculation runs in your browser.

What is the difference between a paired and an unpaired t-test?

A paired t-test analyses the differences within matched pairs, so it removes the variation between subjects. An unpaired (independent) t-test compares two separate groups. Running an unpaired test on paired data ignores the matching and usually gives a much larger p-value: on this page’s heart-rate data, 0.093 instead of 0.00067.

How do you calculate an unpaired t-test?

For two independent groups, divide the difference of the group means by its standard error: t = (x̄₁ − x̄₂) / √(s_p²/n₁ + s_p²/n₂) with n₁ + n₂ − 2 degrees of freedom, or use Welch’s version when the SDs differ. The independent samples t-test calculator does this step by step.

What are the degrees of freedom for a paired t-test?

The degrees of freedom are n − 1, where n is the number of pairs. Ten subjects measured twice give 10 differences and df = 9, not 18, because the test works on the single column of differences.

How do I do a paired t-test on a TI-84?

Put Before in L1 and After in L2, compute the differences with L1 − L2 → L3, then go to STAT → TESTS → 2:T-Test, choose Data, set μ₀ = 0 and List = L3, choose the alternative and press Calculate. The TI-84 shows t, p, x̄ (the mean difference), Sx and n.

Does it matter which column I subtract from which?

For a two-tailed test, no: reversing the subtraction changes only the sign of t. For a one-tailed test it matters, because H₁ must point the right way. This calculator always uses d = Before − After, so a positive mean difference means values decreased.

Can I run a paired t-test with only the mean and SD of each column?

Not from the two column SDs alone, because the test depends on how the pairs move together. You need the SD of the differences, or the two SDs plus the correlation between columns: s_d² = s₁² + s₂² − 2r·s₁·s₂. With s_d in hand, use the Summary of differences option.

What is Cohen’s d_z?

Cohen’s d_z is the mean difference divided by the standard deviation of the differences, d̄ / s_d. It is the standardized effect size that matches the paired t-test, and t = d_z × √n. It is usually larger than a Cohen’s d based on the raw-score SD because pairing removes between-subject variation.

Cite this page

Statculator. (2026, November 14). Paired t-Test Calculator. Retrieved November 14, 2026, from https://statculator.com/hypothesis-tests/paired-t-test-calculator/