Paritian

Statistics

Chi-Square Calculator

Whether counts differ from what you expected, or whether two categories are related, with the p value and the strength of the link.

Results

Chi-square 25.1131
p value 0.000004
What that means The difference is bigger than chance would give
Degrees of freedom 2
The value it had to beat 5.9915
Strength of the link (Cramér's V) 0.2893
Cells 6
Cells expecting fewer than five 0
The test's assumption holds Yes
Count 300

What this tool does

Chi-square is the test for counted things rather than measured ones: how many people chose each option, how many items failed in each batch, how the answers split across age groups. It compares what you counted against what you would have counted if the categories had nothing to do with each other, and turns the gap into a single number. Paste a table of counts, one row per line, and this page returns that number, what it means, and — just as importantly — whether your counts are large enough for the test to be trustworthy at all.

Formula

χ² = Σ (observed − expected)² ÷ expected · in a table, expected = row total × column total ÷ grand total

Variables

SymbolMeaningUnit
modeWhat you are testing
tableThe table, one row per line
observedWhat you counted
expectedWhat you expected, or leave empty for all equal
alphaSignificance level%
OUTChi-square
PVp value
VDWhat that means
DFDegrees of freedom
CRThe value it had to beat
CVStrength of the link (Cramér's V)
CECells
LECells expecting fewer than five
ASThe test's assumption holds
TTCount

Worked example

  • What you are testingtable
  • The table, one row per lineUnder 30 = 60, 40 30 to 50 = 45, 55 Over 50 = 25, 75
  • What you counted30, 14, 34, 45, 57, 20
  • What you expected, or leave empty for all equal
  • Significance level5 %
  • Chi-square25.1131
  • p value0.000004
  • What that meansThe difference is bigger than chance would give
  • Degrees of freedom2
  • The value it had to beat5.9915
  • Strength of the link (Cramér's V)0.2893
  • Cells6
  • Cells expecting fewer than five0
  • The test's assumption holdsYes
  • Count300

Limitations

  • The calculation runs entirely in your browser. The values you type are never sent to a server.
  • For work that must comply with a standard or be signed off, check the result against the applicable code and have it reviewed by a qualified engineer.

Frequently asked questions

How do I write the table?

One row per line: a name, an equals sign, then the counts in that row separated by commas. Every row needs the same number of counts. The columns are whatever you decide they are — the page never sees their names, only the numbers. A two-by-two table has two rows of two counts, and gets one degree of freedom; a three-by-two has two, and so on.

What is the warning about counts under five?

The chi-square test works by approximating a discrete count with a smooth curve, and that approximation falls apart when the expected counts are small. The usual rule is that every expected count should be at least five; when some are not, the p value below is optimistic and the test can call a difference significant that is not. With a two-by-two table and small counts, Fisher's exact test is the right tool instead — it computes the probability directly rather than approximating it.