Advanced

McNemar's Test Calculator — Paired Proportions

McNemar's test compares two binary outcomes measured on the same subjects (or matched pairs). Enter the four cells of the 2×2 table to get the chi-square statistic, p-value (with and without Yates continuity correction), discordant-pair count, and the odds ratio.
Cond A positive AND Cond B positive
Cond A positive AND Cond B negative
Cond A negative AND Cond B positive
Cond A negative AND Cond B negative
p-value (McNemar, Yates corrected)
0.1456

Not significant at α = 0.05

χ² (corrected)
2.1176
p-value (corrected)
0.14561
χ² (uncorrected)
2.8824
p-value (uncorrected)
0.089555
Discordant pairs (b + c)
17
Odds ratio (b / c)
2.4
Proportion positive — Cond A
42%
Proportion positive — Cond B
35%
Total pairs (N)
100
χ² distribution (df = 1): shaded area = p-value
Step by step
  1. 1

    Discordant pairs b + c

    12 + 5 = 17
  2. 2

    |b − c| − 1 (Yates correction)

    |12 − 5| − 1 = 6
  3. 3

    (|b − c| − 1)²

    = 36
  4. 4

    χ² = (|b − c| − 1)² / (b + c)

    36 ÷ 17 = 2.1176
    Matches the χ² (corrected) statistic shown above; df = 1.
Results are estimates for general information only and are not professional advice — always verify important results independently before relying on them. Read the full disclaimer.
Quick answer

How does this calculator work?

McNemar's test compares proportions in paired binary data. Using the discordant cells b and c, χ² = (|b − c| − 1)² / (b + c) with df = 1 gives a p-value via the chi-square distribution. A small p-value means the two conditions differ significantly in the proportion of positive outcomes.

Formula
χ² = (|b − c| − 1)² / (b + c) df = 1 (Yates-corrected McNemar)
How this is calculated

McNemar's test is designed for paired (repeated-measures or matched) binary data, such as before-and-after comparisons or paired case-control studies. The 2×2 table records four counts: a (both conditions positive), b (first positive, second negative), c (first negative, second positive), and d (both negative). Only the discordant cells b and c carry information about whether the two conditions differ — the concordant cells a and d cancel out.

The chi-square statistic is χ² = (b − c)² / (b + c) without correction, or χ² = (|b − c| − 1)² / (b + c) with Yates continuity correction, which reduces the test's slight anti-conservative bias for small samples. Both use df = 1 and the upper-tail chi-square distribution for the p-value, computed here via the regularized incomplete gamma function.

The odds ratio b / c (discordant pairs only) measures the relative shift in positivity between conditions. A small p-value (commonly < 0.05) indicates the proportion of positives differs significantly between condition A and condition B. The test assumes independence of pairs and is inappropriate when the same subject appears in multiple pairs. For very small discordant totals (b + c < 25) an exact binomial test on the discordant pairs is preferred.

Frequently asked questions

Use McNemar's test when your data are paired — the same subjects observed under two conditions, or matched case-control pairs. A standard chi-square test assumes independent groups and is incorrect for paired designs; it ignores the pairing and loses statistical power.

When the total discordant pairs are small (roughly b + c < 25), the chi-square approximation can be inaccurate. In that case prefer an exact test: treat the number of b-type discordant pairs as a Binomial(b + c, 0.5) random variable and compute the exact two-tailed p-value.

The odds ratio b / c compares how many pairs switched from A−/B+ versus A+/B−. An OR of 1 means symmetric switching. OR > 1 means condition B produces more positives relative to condition A; OR < 1 means condition A produces more positives. It is computed only on discordant pairs.

Also known as

mcnemar test calculator
paired proportions test
matched pairs chi square
before after proportion test
discordant pairs test
mcnemar chi square statistic
paired binary outcomes
repeated measures proportion

APA

TG we-Calculate Editorial Team. (2026). McNemar's Test Calculator — Paired Proportions [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/mcnemars-test-calculator

Chicago

TG we-Calculate Editorial Team. "McNemar's Test Calculator — Paired Proportions." TG we-Calculate. 2026. https://we-calculate.com/calculator/mcnemars-test-calculator.

IEEE

TG we-Calculate Editorial Team, "McNemar's Test Calculator — Paired Proportions," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/mcnemars-test-calculator

BibTeX

@misc{wecalculate_mcnemars_test_calculator, title = {McNemar's Test Calculator — Paired Proportions}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/mcnemars-test-calculator}}, year = {2026}, note = {TG we-Calculate} }

Did this calculator help you?