The table-first battery

2×2 Contingency Table Calculator

This 2x2 contingency table calculator analyses one fourfold table with the full standard battery — Fisher's exact test, Pearson chi-square with and without the Yates correction, the G-test, the odds ratio, relative risk, phi and Cramér's V — all from a single grid of four counts. Type or paste your counts and it also runs Cochran's rule on your own expected counts, so you can see which result to trust for this table before you quote any of them.

Table 1. The table-first calculator. Type or paste four counts; every test and association measure below is computed from the same grid. Labels can be renamed.

Reading the table — rows, columns, margins and the grand total

Total
10
6
Total 9 7 16

Zero cells: if a cell is zero, the sample odds ratio is 0 or infinite. This calculator says so in words; it never adds a silent 0.5 correction to make the number finite.

Four numbers in reading order fill a, b, c, d. Pasting a block into any cell fills the grid too.

Worked examples:

The drug-trial table is a constructed teaching example, pre-filled so the result block has real figures to explain. The tea and NIST tables are the cited classics.

Result — the full battery for this table

Fisher's exact testtwo-sided p, by probability ordering — summary depth; for the enumeration,
— the full Fisher test, with enumeration →
Pearson chi-square
— primary
Chi-square with Yates correction
—
G-test (likelihood ratio)
—
Sample odds ratioad / bc — the odds ratio of this table itself
—
Relative riskrisk in row 1 ÷ risk in row 2
—
Phi coefficient (φ)(ad − bc) / √(row and column margins) — signed
—
Cramér's V|φ| for a 2×2 table
—
Which chi-square leads?
Which chi-square leads?

Yates' correction pulls the chi-square p-value toward Fisher's exact p, but it is the more conservative choice: in small samples it can miss associations the uncorrected test would catch, and many statisticians now skip it when Fisher's exact test is available anyway. Both χ² values are always printed above — the toggle only moves the “primary” badge, so the choice is yours and it is never silent.

Which result should you trust?

Expected counts under independence
——
——

Adjusted residuals — which cells drive the result

—
—
—
—

Each adjusted residual compares a cell's observed count with the count expected under no association, scaled so that values beyond ±1.96 are larger than chance alone would typically produce (roughly the 5% level). In a 2×2 table all four adjusted residuals have the same magnitude — the cells move together — so either every cell is flagged or none is.

Effect sizes — how strong is the association?

Sample odds ratioad / bc, from this table's own counts
—
Relative riskthe row-1 rate divided by the row-2 rate
—
Phi coefficient (φ)signed — the sign gives the direction of the association
—
Cramér's V|phi| in a 2×2 table — always between 0 and 1
—

For a 2×2 table, Cramér's V is exactly the absolute value of phi — the two measures coincide in magnitude here, which is not true for larger tables. Both are reported because different literatures ask for different names: phi is the traditional 2×2 measure (and keeps the sign, which shows the direction of the association), while Cramér's V is the general r×c measure that software such as SPSS prints for every table size.

Your counts never leave your browser — the whole battery runs on this page, and the share link encodes the table in the URL itself.

Your results — the whole battery at a glance

One grid of four counts produces eight headline numbers, answering two different questions. The four p-values — Fisher's exact test, Pearson chi-square, Yates-corrected chi-square and the G-test — all test the same null hypothesis of no association, but differently: Fisher's test is exact, the other three are large-sample approximations read off the chi-square distribution with 1 degree of freedom. The four effect sizes — sample odds ratio, relative risk, phi and Cramér's V — answer the second question: how strong the association is. A tiny p-value with a phi of 0.08 is a weak association measured precisely; a p of 0.06 with a phi of 0.55 is a strong one measured loosely. Quote one number from each family, never a p-value alone.

The redundancy is deliberate. On a large, balanced table all four tests agree to two or three decimal places. On a small table they can straddle the 0.05 line — the default drug-trial table gives p = 0.0134 (Pearson), 0.0107 (G-test), 0.0350 (Fisher) and 0.0510 (Yates) — and then the question is which computation is valid for counts this small. The trust panel below the calculator answers that live, from your own expected counts. If you need Fisher's exact test at full depth — the enumeration of every table with your margins, both odds-ratio estimators, the exact confidence interval — that is the homepage calculator; this page keeps Fisher at summary depth on purpose, because the table, not one test, is the product here.

Which result should you trust?

The chi-square family trusts an approximation that holds only when expected counts are not too small. Cochran's rule (Cochran, 1954) states the condition in its exact two-part form: every expected count at least 1, and at least 80% of cells with an expected count of 5 or more — for a 2×2 table, at least 3 of the 4 cells. The panel under the calculator runs that check the moment you type: the four expected counts, the smallest of them, how many cells reach 5, and a sentence naming the result to read. Try it below with your own counts and watch the verdict flip as an expected count drops under 5. When the rule fails, Fisher's exact test — no approximation, no minimum sample size — is the p-value to quote; when it holds, the Pearson chi-square is trustworthy and the two rarely disagree about the conclusion.

Expected counts under no association

————

·

Fisher's exact p (two-sided): — Pearson chi-square p: —

What is a 2×2 contingency table?

A 2×2 contingency table is a two-by-two grid that counts how often each combination of two binary categorical variables occurs: two rows for the levels of one variable, two columns for the levels of the other, and a count in each of the four cells. The row totals, column totals and grand total around the edges are the table's margins.

The four cells are lettered a, b, c and d in reading order, and almost every statistic on this page is a short formula in those letters: the odds ratio is ad/bc, phi is (ad − bc) divided by the square root of the four margins multiplied together, and the expected count in any cell is its row total times its column total divided by the grand total N. The margins matter as much as the cells. Fisher's exact test holds both margins fixed and asks how probable the observed split is among all tables with those margins; the chi-square test compares each observed count with the count the margins predict under independence. Two tables with identical proportions but different totals — [[8, 2], [1, 5]] at N = 16 against [[80, 20], [10, 50]] at N = 160 — share an odds ratio of 20 but very different p-values, because the larger table pins the association down more precisely.

Tables like this arise wherever two yes/no questions are crossed: treatment versus control against improved versus not, exposed versus unexposed against disease versus no disease, variant A versus B against converted versus not. The same structure carries sensitivity and specificity — a test's true and false positives and negatives. One warning: if the same subjects appear in both rows, the data are paired, the independence assumption behind every test here fails, and the right tool is McNemar's test (see the assumptions section).

The tests, one by one

All four tests ask the same question — are the row and column variables associated, or are these counts compatible with independence? — and report a p-value: the probability, under the null hypothesis of no association, of a table at least as extreme as the one observed. They differ in how that probability is computed. One is exact; three are approximations that borrow the chi-square distribution, each with 1 degree of freedom — (2 − 1) × (2 − 1) — for any 2×2 table.

Fisher's exact test

Fisher's exact test computes your table's probability directly from the hypergeometric distribution, holding the margins fixed, and sums the probabilities of every table no more probable than yours. That is the two-sided definition used here — probability ordering, the definition R's fisher.test and SciPy's fisher_exact report. Nothing is approximated, so the test stays valid at any sample size, which is why it leads whenever an expected count is small. On this page Fisher is reported at summary depth — the p-value and the definition — because the full treatment, with the enumeration table, both odds-ratio estimators, the exact Cornfield confidence interval and the APA sentence, is the homepage's job. If your question is specifically about the exact test, go there; if it is about the table as a whole, stay here.

Chi-square test (Pearson)

Karl Pearson's chi-square test of independence (1900) compares each observed count O with the expected count E under independence and sums (O − E)²/E over the four cells. The statistic is read against the chi-square distribution on 1 degree of freedom: the critical value at α = 0.05 is 3.841, so χ² above 3.841 gives p < 0.05. It is an approximation — discrete counts treated as if they followed the smooth chi-square curve — good when expected counts are comfortably large, poor when they are small, which is exactly what Cochran's rule checks. For the default table χ² = 6.112, p = 0.0134: apparently decisive, except the smallest expected count is 2.625 and the approximation is not entitled to that confidence. The dedicated chi-square calculator covers the test in depth, including larger tables and goodness of fit.

Chi-square with Yates continuity correction

Frank Yates (1934) proposed shrinking each |O − E| by 0.5 before squaring, to compensate for approximating discrete counts with a continuous distribution. The correction always makes χ² smaller and p larger — the conservative member of the family. On the default table it moves the result across the significance line, from 6.112 (p = 0.0134) to 3.810 (p = 0.0510), landing close to Fisher's exact 0.0350. Whether to apply it is a genuine, long-running disagreement: R's chisq.test applies it by default for 2×2 tables, while many statisticians argue it over-corrects now that the exact test is cheap. This calculator refuses to decide silently: both χ² values are always printed, a toggle marks which one you treat as primary, and the trade-off is stated where you choose.

G-test (likelihood ratio test)

The G-test replaces the squared differences with a likelihood ratio: G = 2 × Σ O × ln(O/E), summed over the cells with O > 0. It tests the same null hypothesis, uses the same chi-square distribution with 1 degree of freedom, and is the third approximation in the battery — for the default table G = 6.515, p = 0.0107, the smallest p of the three. It is the standard choice inside log-linear models, and its approximation degrades under the same small-expected-count conditions as Pearson's, so the trust panel's verdict covers it too. When the three approximations disagree with each other, that disagreement is itself the signal that the counts are too small for any of them and the exact test should lead.

Effect sizes — how strong is the association?

A p-value mixes two things: how strong the association is and how much data you have. With N = 16 a strong association can miss significance; with N = 16,000 a trivial one can reach p < 0.001. Effect sizes separate strength from sample size, which is why four are printed beside every p. The odds ratio and relative risk speak in the study's units; phi and Cramér's V compress the association onto a standardised scale comparable across studies. Report at least one of each kind.

Odds ratio and relative risk

The sample odds ratio is the cross-product ad/bc: for the default table, (8 × 5)/(2 × 1) = 20.0 — the odds of improvement on treatment are 20 times the odds on control. It is the sample odds ratio because it comes straight from your four counts; the conditional maximum-likelihood estimate R reports for the same table is a different, model-based figure (15.47 here), and it lives on the odds ratio calculator with its confidence intervals. The relative risk compares rates instead: (8/10)/(1/6) = 4.80. The two diverge when the outcome is common — 20.0 against 4.80 for identical data — because odds stretch ratios as rates approach 1. Quote the one your field expects, and never read an odds ratio as a risk ratio.

Phi coefficient

Phi is the correlation between the two binary variables, computed directly from the table: φ = (ad − bc)/√(r₁r₂c₁c₂), equivalently √(χ²/N) with the sign of ad − bc restored. It runs from −1 to +1: 0 is no association, and the sign shows direction — positive when the diagonal cells a and d dominate, as in the default table (φ = +0.618), negative when the off-diagonal dominates. For the tea table [[3, 1], [1, 3]], φ = 0.5 exactly. The usual reading bands are 0.1 small, 0.3 medium, 0.5 large — conventions, not laws. At 0.618 the default table's association is large; few real treatment effects reach it, which is itself a reason to double-check a small table that produces one.

Cramér's V

Cramér's V, named for Harald Cramér, generalises phi to tables of any size: V = √(χ²/(N × (k − 1))), where k is the smaller of the row and column counts. For a 2×2 table k − 1 = 1, so V = √(χ²/N) = |φ| exactly — 0.618 for the default table. V is always between 0 and 1 and carries no sign, making it the safer figure when direction is obvious from the table or when your software reports it by default, as SPSS does for every crosstab. Both are printed because the literatures differ — psychology and older texts ask for phi, survey research asks for Cramér's V — and on a 2×2 table they are the same magnitude under two names.

Expected counts — observed vs expected

Every test in the battery is, underneath, a comparison of what you observed with what independence predicts. The expected count in a cell is its row total times its column total divided by the grand total: E = r × c / N. For the default table — margins 10 and 6, 9 and 7, N = 16 — the expected counts are 5.625, 4.375, 3.375 and 2.625: the table independence would produce, on average, from these margins. The gaps (8 against 5.625, 1 against 3.375) are the raw material of everything else: χ² squares and scales them, the G-test weighs them by likelihood, and the residuals below standardise them cell by cell. Expected counts also carry the validity check — they, not the observed counts, are what Cochran's rule inspects, because the approximation fails when predicted counts are small even if observed ones look healthy. A table can have no zero cells and still fail the rule, as the default table does at 2.625.

Adjusted residuals — which cells drive the result

A significant p-value says the table as a whole departs from independence; residuals say where. The standardised residual, (O − E)/√E, puts each cell's gap on a common scale; the adjusted residual refines it by dividing further by √((1 − rowTotal/N)(1 − colTotal/N)), accounting for the cell's share of its margins. Adjusted residuals behave roughly like z-scores, so |adjusted residual| above 1.96 — the 5% two-sided normal cut-off — flags a cell contributing more than chance alone would typically produce. For the default table all four are ±2.47: a and d above expectation, b and c below, all flagged. That symmetry is a property of the 2×2 case, not a coincidence — with one degree of freedom the four residuals are forced to share a single magnitude, so in a fourfold table either every cell drives the result or none does. In larger tables the flags separate.

CellObservedExpectedStandardised residualAdjusted residual
a — Treatment × Improved — — — —
b — Treatment × Not improved — — — —
c — Control × Improved — — — —
d — Control × Not improved — — — —

Adjusted residuals beyond ±1.96 mark cells contributing more than chance alone would typically explain. In a 2×2 table all four share one magnitude — try the tea table [[3, 1], [1, 3]] and watch all four drop to ±1.41.

Worked example — one table, every statistic by hand

The drug-trial table [[8, 2], [1, 5]], the whole battery by hand

A small trial: 10 patients on a treatment, 6 on control. 8 of the 10 treated patients improved and 2 did not; 1 of the 6 controls improved and 5 did not. N = 16; row margins 10 and 6, column margins 9 and 7. Every figure below uses only the formulas on this page — type the table into the calculator and the explorer under this example to reproduce each one.

  1. Expected counts: E = row total × column total ÷ N. E(a) = 10 × 9/16 = 5.625; E(b) = 10 × 7/16 = 4.375; E(c) = 6 × 9/16 = 3.375; E(d) = 6 × 7/16 = 2.625. The observed-minus-expected gap is ±2.375 in every cell.
  2. Cochran's rule: only 1 of the 4 expected counts reaches 5, and the smallest is 2.625 — the rule is not met, so the chi-square approximations are on probation and Fisher's exact test is the result to trust.
  3. Pearson chi-square: χ² = Σ(O − E)²/E, cell by cell: 2.375² ÷ 5.625 = 1.003; 2.375² ÷ 4.375 = 1.289; 2.375² ÷ 3.375 = 1.671; 2.375² ÷ 2.625 = 2.149. Sum: χ² = 6.112. On 1 degree of freedom, p = 0.0134.
  4. Yates correction: shrink each gap by 0.5 first — (2.375 − 0.5)² = 3.515625 — so χ² = 3.515625 × 1.08355 = 3.810, p = 0.0510. The correction alone moves this table across the 0.05 line.
  5. G-test: G = 2 × Σ O ln(O/E) = 2 × [8 ln(8/5.625) + 2 ln(2/4.375) + 1 ln(1/3.375) + 5 ln(5/2.625)] = 2 × 3.2576 = 6.515, p = 0.0107.
  6. Fisher's exact test: with the margins fixed, the observed table's hypergeometric probability is 0.023601; summing the tables no more probable than it (probability ordering) gives the two-sided p = 0.0350 — between the optimistic approximations and the conservative Yates figure, and the only exact one of the four.
  7. Odds ratio and relative risk: OR = ad/bc = (8 × 5)/(2 × 1) = 20.0. RR = (8/10)/(1/6) = 4.80. Same table, two honest answers — odds stretch the ratio because the outcome is common.
  8. Phi and Cramér's V: φ = (ad − bc)/√(10 × 6 × 9 × 7) = 38/√3780 = 0.618, and V = |φ| = 0.618. Cross-check: √(χ²/N) = √(6.112/16) = 0.618. On the 0.1 / 0.3 / 0.5 bands, a large association.
  9. Adjusted residuals: for cell a, (8 − 5.625)/√(5.625 × (1 − 10/16) × (1 − 9/16)) = 2.375/0.9607 = +2.47. All four cells give ±2.47, past ±1.96, so every cell is flagged as driving the result — the forced symmetry of a 2×2 table.
  10. The verdict to report: Fisher's exact p = 0.0350, odds ratio 20.0, φ = 0.618 — a significant, large association in a very small sample, quoted from the exact test because Cochran's rule failed, with the sample size stated so the reader can weigh it.

Fisher p = 0.0350 (the figure to trust here) · Pearson χ² = 6.112, p = 0.0134 · Yates χ² = 3.810, p = 0.0510 · G = 6.515, p = 0.0107 · OR = 20.0 · RR = 4.80 · φ = V = 0.618 · adjusted residuals ±2.47.

CellObservedExpectedStandardised residualAdjusted residual
a — Treatment × Improved — — — —
b — Treatment × Not improved — — — —
c — Control × Improved — — — —
d — Control × Not improved — — — —

The worked example's own numbers: observed 8, 2, 1, 5 against expected 5.625, 4.375, 3.375, 2.625, with all four adjusted residuals at ±2.47.

Which test should I use for a 2×2 table?

Start from the expected counts, not from habit. Compute E = row total × column total ÷ N for each cell (the calculator does it live), check Cochran's rule, and let the table's own numbers pick the test:

Decision table for a 2×2 table: the situation in your data, the result to read, and where it lives.
All expected counts ≥ 5 and none below 1Pearson chi-squareCochran's rule is met, so the approximation is trustworthy; Fisher will agree closely. Both are printed above.
Any expected count below 5, or a small total NFisher's exact testThe exact test needs no large-sample approximation. Summary p above; full depth on the homepage.
Your journal or software defaults to a corrected chi-squareYates-corrected chi-squarePrinted beside the uncorrected value above — never instead of it, and expect it to sit closer to Fisher's p.
A log-linear model or likelihood frameworkG-testThe likelihood-ratio member of the family; same df = 1, same small-count cautions as Pearson.
The same subjects measured twice (before/after, matched pairs)McNemar's test — not any test on this pagePaired counts break the independence assumption. Use the McNemar calculator.
More than two rows or columnsFisher–Freeman–Halton exact testThe exact test generalised to r×c tables — the Freeman–Halton calculator.

Assumptions and when NOT to use these tests

Every test in the battery shares the same foundations, and breaking one breaks all four. The data must be counts — whole numbers of observations — never percentages, rates or means pasted into the grid; a table of percentages has lost its sample size, and with it every p-value. Each observation falls in exactly one cell, and observations are independent: one patient's outcome cannot be another patient's row. The categories are fixed in advance — collapsing a three-level outcome into two after seeing the counts, or choosing which diagonal to feature once the p-values are in, quietly manufactures significance. And an association, however exact its p-value, is not causation: these tests say the rows and columns move together in this sample, nothing about why. The chi-square members add one condition of their own — expected counts large enough for the approximation, checked by Cochran's rule — while Fisher's test conditions on both margins.

Paired data? Use McNemar's test instead

If the same people, patients or items were measured twice — before and after treatment, left eye and right eye, matched case and control — the two rows are not independent samples and every p-value on this page is the wrong computation. McNemar's test is built for that design: it ignores the concordant pairs and tests only the discordant ones (the b and c cells of the paired table), asking whether switches in one direction outnumber switches in the other. The tell-tale signs are a grand total twice the number of subjects, or rows labelled with two time points for one group. If that is your table, take it to the McNemar test calculator — pasting it here would silently treat paired data as independent and overstate the evidence.

Bigger table? Fisher–Freeman–Halton

Once a variable has three or more levels the table outgrows this page: ad/bc and phi lose their single-number meanings, and the exact test generalises to the Fisher–Freeman–Halton test, which enumerates tables across the larger grid — use the Fisher–Freeman–Halton calculator for r×c tables, where Cramér's V survives as the effect size and chi-square gains (r − 1)(c − 1) degrees of freedom. One design sits beyond both pages: if your 2×2 tables are stratified — one per clinic, age band or study — pooling them into a single table can reverse the association entirely (Simpson's paradox). Stratified 2×2 data is Cochran–Mantel–Haenszel territory: that test is named here as the pointer, deliberately not calculated on this page, because it needs the per-stratum tables, not their sum.

How to report a 2×2 table analysis

A complete report has four ingredients, and the battery supplies all of them. First, the table itself — the four counts with their margins, or at least the group sizes and rates, so a reader can rebuild every number. Second, the test you read and why: name it, give its statistic and degrees of freedom where it has one, and give the p-value to three or four decimal places rather than “p < 0.05”. Third, an effect size — the odds ratio or relative risk in the study's units, phi or Cramér's V standardised — because the p-value cannot carry the size of the effect. Fourth, the sample size, stated beside the result: N = 16 and N = 1,600 behind the same p-value are very different claims.

In APA-flavoured form the chi-square line for the default table reads χ²(1, N = 16) = 6.11, p = .013, φ = .62 — but for this table that is the wrong line to lead with, because Cochran's rule failed. The honest report names Fisher's exact test as the primary analysis (p = .035, two-sided), gives the odds ratio of 20.0, and notes the small expected counts that motivated the choice. The full APA treatment of the exact test — the sentence template, which odds-ratio estimator pairs with the exact interval, the two-sided definition note — lives on the homepage, where Fisher's test is the product. And never report a p-value as “.000”: a p-value is a probability, never exactly zero — write p < .001.

Frequently asked questions

How do you analyse a 2×2 contingency table?

In five steps. (1) Enter the four counts — counts, not percentages — with clear row and column labels. (2) Compute the expected counts, E = row total × column total ÷ N, and check Cochran's rule: all E ≥ 1 and at least 80% of cells with E ≥ 5. (3) Read the test the rule points to: Fisher's exact test when it fails, Pearson chi-square when it holds. (4) Read an effect size beside the p-value — odds ratio or relative risk in the study's units, phi or Cramér's V standardised. (5) Check the adjusted residuals to see which cells drive the result. The calculator above performs all five on one grid.

Which test should I use for a 2×2 table?

Let the expected counts decide. If every expected count is at least 1 and at least 3 of the 4 cells have E ≥ 5 (Cochran's rule), the Pearson chi-square approximation is trustworthy and every test in the battery tells the same story. If any expected count is small — the common case in small studies — read Fisher's exact test, which computes the probability exactly at any sample size. The trust panel under the calculator runs this check on your own table and names the result to read.

What is the phi coefficient in a 2×2 table?

Phi is the correlation between the two binary variables, computed straight from the four cells: φ = (ad − bc)/√(r₁r₂c₁c₂), which equals √(χ²/N) with the sign of ad − bc. It runs from −1 to +1 — 0 is no association, the sign gives the direction, and the usual bands are 0.1 small, 0.3 medium, 0.5 large. For the drug-trial table [[8, 2], [1, 5]], φ = 38/√3780 = 0.618. In a 2×2 table Cramér's V is exactly |φ|.

When should you use Fisher's exact test instead of chi-square?

Whenever the chi-square approximation cannot be trusted: any expected count below 1, fewer than 80% of cells with E ≥ 5 (for a 2×2, fewer than 3 of 4), or a small grand total where the discrete tables sit far apart. Fisher's test computes the exact hypergeometric probability of the tables with your margins, so it stays valid at any sample size — its only cost is computation, which a browser does instantly. This page reports Fisher at summary depth; the full enumeration and exact confidence interval are on the homepage calculator.

How do you calculate degrees of freedom for chi-square?

For a test of independence, (rows − 1) × (columns − 1). A 2×2 table therefore always has (2 − 1) × (2 − 1) = 1 degree of freedom: once the margins are fixed, only one cell can vary freely and the other three are determined. Every chi-square and G statistic on this page is compared with the χ²₁ distribution, whose 5% critical value is 3.841. A larger r×c table has (r − 1)(c − 1) degrees of freedom.

What are the assumptions of the chi-square test?

Four. The data are counts of independent observations, each in exactly one cell. The categories are fixed in advance, not merged or split after seeing the data. The expected counts are large enough for the approximation — Cochran's rule: every E ≥ 1 and at least 80% of cells with E ≥ 5. And the observations are not paired: the same subject in both rows breaks independence, which is McNemar territory. Fisher's exact test drops the expected-count condition but keeps the others.

Which odds ratio does the tool report?

The sample odds ratio, ad/bc, computed directly from your four counts — 20.0 for the default table. Not the conditional maximum-likelihood estimate R's fisher.test prints (15.47 for the same table), and no interval is attached to it here. If a cell is zero, the sample odds ratio is honestly 0 or infinite; the calculator says so in words rather than adding a silent 0.5 correction. The odds ratio calculator covers both estimators with the exact Cornfield and Woolf intervals.

When do I need McNemar's test?

When the table is paired: the same subjects measured twice (before/after), matched pairs, or two tests applied to the same samples. Then the rows are not independent, and Fisher, chi-square and the G-test all compute the wrong probability. McNemar's test uses only the discordant pairs — subjects who switched one way versus the other. A grand total equal to twice the number of subjects is the usual giveaway. Use the McNemar test calculator for paired tables.

Is my data uploaded anywhere?

No. Every calculation on this page — the exact test, the chi-square family, the residuals, the trust check — runs in your browser, and nothing is sent to a server. The share link encodes the four counts in the URL itself, so a recipient sees the same table without any data passing through us. Load the page, disconnect, and the battery keeps working offline.