McNemar Test Calculator
Analyze matched binary outcomes using an exact discordant-pair binomial test and two chi-square approximation conventions.
YOUR CALCULATION
Result
—
Calculation steps
Work through one step at a time or reveal the complete calculation. The steps use your current inputs.
How to calculate
Use only the off-diagonal discordant counts for a paired marginal-symmetry test; keep concordant cells in the descriptive table.
Exact p=min(1,2×P[Binomial(b+c,0.5)≤min(b,c)]); χ²=(b−c)²/(b+c)
Worked example
Discordant cells b=8,c=2 give exact two-sided p=0.109375. Concordant cells do not affect that p-value. Uncorrected chi-square is 3.6.
Assumptions and input details
Counts are nonnegative whole numbers up to 1e7 per cell, with at most 20000 discordant pairs b+c. The table must represent the same paired subjects/items under two binary measurements. Exact tails are inclusive, with no mid-p adjustment. Zero discordance leaves the test undefined. Approximate p-values are additionally labeled with/without the statsmodels continuity correction (|b−c|−1)²/(b+c). This is not an independent-samples contingency or treatment-effect estimate.
References: statsmodels: exact and approximate McNemar conventions
Using this calculator
Can I enter my own problem?
Yes. Replace the example values with your own inputs. The result, calculation steps, tables and applicable diagrams update from those inputs. Blank or invalid values clear the result; example values are never silently substituted for missing inputs.
Are the results exact?
Results use floating-point arithmetic and displayed rounding. Read the formula, assumptions and any stated data precision before interpreting the result.
Is my input uploaded?
The calculation runs in your browser. No account, file upload or external AI service is required. Inputs are not saved between page reloads.
Calculate conditional two-sided probability-ordering and one-sided Fisher exact p-values for a 2×2 count table.
Calculate observed agreement, marginal chance agreement and unweighted Cohen’s kappa from a paired binary rating table.
Test an entered mean paired difference with a two-sided Student t calculation and confidence interval from raw paired observations.
Reserved advertising space.