Skip to content
ToolMug

Chi-Square Test Calculator

Do men and women answer a survey question differently? Is a die fair? Paste your cross-tabulated counts from Excel and get the chi-square result instantly, with Fisher's exact test for small 2 × 2 tables.

Runs in your browser — nothing you enter is uploaded

One row per line, columns separated by spaces or tabs — paste straight from Excel.

χ²
0.7937
Degrees of freedom
1
p-value
0.3730
Cramér's V
0.089
Fisher’s exact test p
0.5045

Results match R’s chisq.test() and fisher.test(). Cramér’s V measures the strength of association (0 = none, 1 = perfect).

How to use

  1. Choose Contingency table or Goodness of fit.
  2. For a table, paste one row of counts per line; for goodness of fit, enter observed counts and optional expected proportions.
  3. Read χ², degrees of freedom and the p-value, and note any small-count warning.

Options explained

Independence test
Expected = row total × column total ÷ grand total; χ² = Σ(observed − expected)² ÷ expected; df = (rows − 1)(columns − 1).
Fisher's exact test
For 2 × 2 tables, sums exact hypergeometric probabilities — more reliable than χ² with small samples.

Worked example

Suppose 100 people answered a yes/no question and the observed counts are:

Group Yes No
Group A 30 20
Group B 20 30

Every row and column total is 50 and the grand total is 100, so each expected count is 50 × 50 ÷ 100 = 25. Then χ² = 4 × (5² ÷ 25) = 4.00, with (2 − 1)(2 − 1) = 1 degree of freedom. The p-value is about 0.0455, below the usual 0.05 level.

Critical values of χ² at the 0.05 level:

Degrees of freedom 1 2 3 4 5
Critical value 3.841 5.991 7.815 9.488 11.070

If your χ² is larger than the critical value for your degrees of freedom, the p-value is below 0.05.

Frequently asked questions

Should I use the Yates correction?

It is sometimes used for small 2 × 2 tables, and R applies it by default, but Fisher's exact test is now generally preferred.

Must the inputs be counts?

Yes — frequencies (people, occurrences), not percentages or means.

Is my data uploaded?

No. Calculations run in your browser.

Privacy

This tool runs entirely in your browser. Your files and text are processed on your device and are never uploaded to our servers.

Related tools