McNemar's Test Calculator
Test whether a paired binary outcome changed — before-and-after on the same subjects, where only the disagreements carry information.
For paired yes/no data, the subjects who answered the same way both times tell you nothing about change.
How the mcnemar's test calculator works
For paired yes/no data, the subjects who answered the same way both times tell you nothing about change. McNemar's test looks only at the discordant pairs: χ² = (b − c)² ÷ (b + c) on 1 degree of freedom.
When b + c is small the chi-square approximation fails, so the calculator also gives the exact binomial p-value — which is the one to read below about 25 discordant pairs.
Formula: χ² = (b − c)² / (b + c), df = 1
Worked examples
| Inputs | Chi-square statistic | Note |
|---|---|---|
| 25 switched one way, 12 the other | 4.567568 | χ² = 4.57, p = 0.033 |
| An even split | 0 | χ² = 0, p = 1 |
| Few pairs changed | 5.444444 | read the exact p-value here |
FAQFrequently asked questions
What is McNemar's test for?
Paired binary data — the same subjects measured twice, or matched pairs, with a yes/no outcome.
Why do the unchanged pairs not count?
Because they are consistent with any amount of change in either direction. Only the switchers carry information about the direction of change.
When should I use the exact version?
When there are fewer than about 25 discordant pairs. Below that the chi-square approximation is unreliable.
How is it different from a chi-square test of independence?
Completely. That tests whether two variables are related across independent observations; this tests whether a paired proportion moved.
Where is it used?
Before-and-after surveys, matched case-control studies, and comparing two diagnostic tests on the same patients.
Where these figures come from
- NIST Digital Library of Mathematical Functions — reference definitions for elementary and special functions
- Wolfram MathWorld — definitions and formulas for every topic on this page
- NIST/SEMATECH e-Handbook of Statistical Methods — the statistical formulas (mean, variance, z, confidence intervals, sample size)
- Common Core State Standards — Mathematics — the terms and methods taught in US schools
Last checked: September 2026. Formulas are fixed by mathematics and do not change with tax years or regulations.