Calculators
Home › Calculators › Chi-Square Test

Chi-Square Test Calculator

One page, both chi-square tests: pick the one that matches your data.

Published 14 November 2026

Run a chi-square test

Choose the test that matches your data, then paste the counts.

Quick answer: Pick your test, paste the counts. The die: χ²(5) = 13.0, p = 0.0234, so the rolls do not fit fair. The revision table: χ²(2) = 6.84, p = 0.0328, Cramér's V = 0.217, a real but modest association. Both tests show their working, step by step.

Two chi-square tests, one question each

A teacher keeps a die in her desk drawer. She rolls it 60 times during a probability lesson, and the six comes up 20 times. Same week, she sorts her class by revision method and pass or fail, and wonders whether the method matters at all. Two tables of counts. Two chi-square tests. They look alike, and the arithmetic is nearly the same. Pick the wrong one, though, and the numbers still come out. They just answer a question nobody asked.

Your dataThe testWhat it asks
One set of counts against a claimed splitGoodness of fitDo the counts fit the claim?
A table crossing two variablesTest of independenceAre the two variables associated?

That is the whole decision. One row of counts, or a table. A fair die is one row. A survey crossed by age band is a table. Count the dimensions before you touch the calculator, and the choice makes itself.

The two worked examples, side by side

Worked example: goodness of fit

Sixty rolls of a die: 20, 8, 10, 6, 9, 7 against 10 expected per face. The 20 alone contributes (20−10)²/10 = 10 of the total χ² = 13.0 (df 5, p = 0.0234). At 0.05 the verdict is: this die's rolls do not fit "fair". Read the contributions table before the p-value. One swollen face is a different story from a general misfit, and the statistic keeps them separate for you. The dedicated goodness-of-fit calculator runs this same test with the per-category table.

Worked example: test of independence

Three revision methods against two outcomes (pass/fail counts 30/20, 25/25, 15/30; N = 145): χ² = 6.836 on 2 df, p = 0.0328. Method and outcome are associated at the 0.05 level. Cramér's V = 0.217, a small-to-moderate association: real, but method explains only part of who passes. The observed-vs-expected table shows where: method 3 passes fewer students than independence predicts (15 observed against 21.7 expected) and fails more (30 against 23.3 expected). The dedicated test of independence calculator runs this same test with the full table and Cramér's V.

Reading the output, in order

Start with the statistic and its degrees of freedom. A χ² of 13.0 on 5 df is a different claim from 13.0 on 2 df, because the curve the statistic is read on changes with df. Then the p-value: how often a statistic this large would turn up by luck alone if the null were true. Then the size of the effect. For a table, that is Cramér's V, which rescales the statistic to a 0 to 1 scale so strength can be compared across tables. For a single row of counts, it is the contributions table: which categories carry the misfit. Report all three and the reader never has to guess what you found.

The expected-count rule

The chi-square curve is an approximation, and it frays when an expected count is small. Roughly 5 per cell is the line most courses teach. Below it, merge thin categories with their neighbours, or switch instruments. For a 2x2 table with small counts, Fisher's exact test is built for that corner, and the Fisher's exact test calculator runs it. For a single row of counts with tiny expectations, an exact multinomial calculation is the honest route.

There is one more habit worth breaking. Percentages and proportions do not belong in a chi-square test. The statistic is built from counts. Sixty rolls and 600 rolls with identical proportions are very different evidence, and only the counts know it. Paste the raw numbers, always.

Watch out

Running the independence test on a single row of counts. A table needs two variables. One row has one, and the expected counts the test builds from the margins collapse into nonsense. If your data is one row against a claim, that is goodness of fit, and the calculator's first option is the one you want.

Association is not causation

A significant independence test certifies pattern, not mechanism. The revision methods differ in pass rates. They may also differ in who chose them: stronger students picking the method their friends praise, weaker ones left with the rest. Observational tables cannot untangle that. Random assignment can. Report the association and Cramér's V honestly, and let the design carry the causal claims.

Assumptions, in plain sight

Meet those four and the test is honest. Break one and the p-value is decoration. The guide to choosing a statistical test puts chi-square beside the t-test, ANOVA and the rank tests, so you can see at a glance which family your question belongs to.

Frequently asked questions

Which chi-square test do I need?

Count the dimensions. One row of counts against a claimed split: goodness of fit. A table crossing two variables: independence. A die against fair is one row; revision method by pass or fail is a table. If your data is a single row, the independence test cannot even start: it needs two variables to cross.

Why is there no one-tailed chi-square test?

The chi-square statistic only grows when the data disagree with the null, and it can never go negative. The test rejects for large values only, which is already a one-sided question on the right tail. Direction does not apply here the way it does to a mean: there is no 'below' worth testing.

What does Cramér's V add?

Chi-square grows with sample size even for weak associations, so the statistic alone cannot say how strong the pattern is. V rescales it to 0 to 1: roughly 0.1 is small, 0.3 medium and 0.5 large for the usual tables. The revision example's V of 0.217 is small-to-moderate: real, but method explains only part of who passes.

What if an expected count is below 5?

Merge thin categories with neighbours where that makes sense, so the counts fatten up. For a 2x2 table with small counts, Fisher's exact test is the safer instrument. For a single row of counts, an exact multinomial calculation replaces the approximation.

Can I use percentages instead of counts?

No. The statistic is built from counts: 60 rolls and 600 rolls with identical proportions are very different evidence. Paste the raw numbers, and the calculator works out the expected counts from them.