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.
Not significant at α = 0.05
- 1
Discordant pairs b + c
12 + 5 = 17 - 2
|b − c| − 1 (Yates correction)
|12 − 5| − 1 = 6 - 3
(|b − c| − 1)²
6² = 36 - 4
χ² = (|b − c| − 1)² / (b + c)
36 ÷ 17 = 2.1176Matches the χ² (corrected) statistic shown above; df = 1.
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
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
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
TG we-Calculate Editorial Team. "McNemar's Test Calculator — Paired Proportions." TG we-Calculate. 2026. https://we-calculate.com/calculator/mcnemars-test-calculator.
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
@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?
