Chi-Square Test Calculator

The chi-square test of independence checks whether two categorical variables are associated, for example gender and preferred learning method. Paste a table of counts of any size, with or without labels. You get the χ² statistic, p-value, expected counts, adjusted residuals showing which cells drive the result, Cramér’s V (or phi for 2×2 tables), an optional Yates correction and an APA sentence. For 2×2 tables, Fisher’s exact test is calculated automatically.

How to enter a contingency table

Paste the table from Excel, or type it with tabs, commas or spaces between counts and one row per line. Row and column labels in the first column and first row are optional but make the output easier to read. Every cell must be a count (a whole number), not a percentage.

Formula

Expected count E = (row total × column total) ÷ N · χ² = Σ (O − E)² ÷ E · df = (r − 1)(c − 1)

Reading the residuals

A significant χ² says the variables are related but not how. The adjusted standardized residuals answer that question. A cell with a residual above +1.96 has noticeably more observations than expected under independence, and one below −1.96 has noticeably fewer. These cells are where the association lies.

Effect size: Cramér’s V

TableSmallMediumLarge
2×2 (phi, df = 1)0.100.300.50
Smaller dimension = 3 (df* = 2)0.070.210.35
Smaller dimension = 4 (df* = 3)0.060.170.29

Assumptions

  • Each observation is counted in exactly one cell, and observations are independent.
  • Expected counts are at least 5 in most cells. The calculator warns you when they aren’t. For a 2×2 table, use the Fisher’s exact result shown below the main output.

Frequently asked questions

Should I use the Yates continuity correction?

Yates’ correction makes the 2×2 chi-square test more conservative. Many modern statisticians prefer the uncorrected test with large samples and Fisher’s exact test with small ones. The option is there if your course or journal requires it, and SPSS reports both.

Can I use percentages?

No. The test needs the actual counts, because its result depends on the sample size. Convert percentages back to counts first.