Chi-Square Test of Independence calculator

Perform a Chi-square test of independence on a contingency table. Get p-value, expected frequencies, and Cramér's V online.

What it does

Tests whether two categorical variables are associated by comparing observed cell counts against what independence would predict; automatically falls back to Fisher's exact test when expected counts are too small.

Cautions

How to read the output

The contingency table
Counts in every combination of categories, with row and column totals. Read the percentages, not the raw counts, when the groups differ in size. Each row of your data must contribute exactly one cell. Repeated measurements on the same subjects break the test's independence assumption and make p too small.
χ² statistic and df
How far the observed counts sit from what independence would predict; df is (rows − 1) × (columns − 1).
Fisher's exact p and the expected-count note
On a 2×2 table, when any expected count falls below 5 the χ² approximation is unreliable, so the exact test is computed and the note appears. When the note appears, report Fisher's p — the χ² value is still printed and will look reassuringly similar, which is not evidence the approximation held. On a table larger than 2×2 neither the note nor Fisher's p appears even with sparse cells, because the classical exact test does not extend to r×c: check the expected counts yourself and collapse categories if they are thin.
p-value
How surprising a difference at least this large would be IF the groups really were identical on this measure. A small p means the data would be surprising under that assumption. It is not the probability that the result is due to chance, and not the probability that the groups are the same — those read the conditional backwards. It also answers 'would this be surprising?', never 'is this big enough to matter?': with a large sample a trivial difference returns a small p, and the result looks identical to an important one.

How this calculator is validated · Which statistical test should I use?