Home · Statistics · Inference & Tests · McNemar's Test Calculator

McNemar's Test Calculator

McNemar's test for paired binary data: a chi-square statistic built only from the pairs that changed, with the standard continuity correction.

Your figures

Example result — edit the figures to make it yours

6.6176

p-value (continuity-corrected)1.009731%
Uncorrected chi-square7.529412
p-value (uncorrected)0.606997%

What this calculator does

McNemar's test for paired binary data: a chi-square statistic built only from the pairs that changed, with the standard continuity correction. Every figure on this page is computed from the standard definition stated below — the same definition used in textbooks and reference tables — with no hidden rounding steps, and the method notes name the exact convention where more than one exists.

The formula and method

χ² = (|b − c| − 1)² / (b + c), on 1 degree of freedom

Only the discordant pairs matter: b pairs that switched one way and c pairs that switched the other. Pairs that stayed the same carry no information about change.

The −1 is the continuity correction, standard for this test because the statistic is discrete but judged against the continuous chi-square distribution.

Compare the result with the chi-square distribution on 1 degree of freedom (3.84 at the 5% level). The approximation needs b + c reasonably large, roughly 25 or more.

Worked example

With the example inputs this page opens with (discordant pairs b (changed one way) 25, discordant pairs c (changed the other way) 9), the result is 6.6176. Change any figure and the result updates with the same formula.

Quick reference

Quick reference — varying discordant pairs b (changed one way)
Discordant pairs b (changed one way)Result
203.4483
256.6176
5027.1186
267.3143
278.0278
3010.2564

Computed with the same formulas as the calculator above — enter any values there for figures beyond this table.

Common questions

Why do the unchanged pairs not count?

McNemar's question is whether change runs one way more than the other. A pair that reads the same before and after is consistent with any balance of switching, so it cannot evidence a direction; only the b-versus-c imbalance can.

What if b + c is small?

Below roughly 25 discordant pairs the chi-square approximation is unreliable. The exact version treats b as binomial with p = 0.5 out of b + c trials and reports that exact probability instead.

How does the McNemar's Test Calculator work?

McNemar's test for paired binary data: a chi-square statistic built only from the pairs that changed, with the standard continuity correction. Discordant pairs b · Discordant pairs c → McNemar chi-square. The result updates as you type, and the formula and method on this page state the exact definitions used, so you can reproduce the calculation by hand.

What inputs does the McNemar's Test Calculator need?

Discordant pairs b · Discordant pairs c → McNemar chi-square. Invalid entries — such as a zero denominator, an out-of-range value or a malformed list — produce a plain-language message instead of a misleading number.