Skip to content
MasterMath

Chi-Square Test Calculator

The chi-square test compares the frequencies you observed with the ones you would expect, and says whether the gap is bigger than reasonable. Leave the expected values empty and they are split evenly.

Chi-square

—

Chi-square—
p-value—
Degrees of freedom—
Critical value at 95 %—
Conclusion—
Check—
CategoryObservedExpectedAdds to χ²

How this was worked out

    The formula

    χ² = Σ (observed − expected)² / expected

    What it means

    Each category contributes the difference between observed and expected, squared and divided by the expected. That division is the key: a gap of ten is enormous if you expected five and negligible if you expected a thousand. The total of all those contributions is compared against the chi-square distribution, which says how unusual that total would be if the gaps were pure chance.

    How to work it out by hand

    1. Note the observed frequency of each category
    2. Work out the expected ones: split evenly, or in whatever proportion applies
    3. In each category, subtract, square and divide by the expected value
    4. Add all the contributions and compare against the critical value

    What is worth knowing

    The approximation breaks down when any expected frequency drops below five, which is why you get a warning: with cells that small the p-value stops being trustworthy and categories need merging, or an exact test is called for. Watch what goes into the table too: chi-square works on counts, never on percentages or averages. Feeding it percentages is a silent mistake, because the arithmetic works and the answer means nothing.

    Frequently asked questions

    What do I enter if I have no expected values?

    Nothing: leave the field empty and the total is split evenly across the categories, which is the "no preference" hypothesis.

    Can I use percentages?

    No. The test needs counts. With percentages the arithmetic works but the answer means nothing.

    What if a cell expects fewer than five?

    The approximation stops being reliable. Merge categories or use an exact test instead.

    How many degrees of freedom does it have?

    The number of categories minus one, when comparing against given expected values.

    What does a small p-value mean?

    That the gaps between observed and expected are hard to explain by chance alone.