Part of the Maths & Statistics suite · 235 calculators

Chi-Square Test Calculator

Test whether two categorical variables are related — the chi-square test of independence on a 2×2 table, with the expected counts and effect size.

Under independence, the expected count in each cell is (row total × column total) ÷ grand total.

Results update as you type
Results
Chi-square statistic
4.8
p-value
Degrees of freedom
Decision at 5%
Smallest expected count
Phi (effect size)
Odds ratio
Total observations
Assumption check
Reviewed September 2026. Pure mathematics: the result does not depend on where you are. Terminology follows the national curriculum (maths, brackets, decimal point).
No account required · Google Analytics off unless allowedCalculator arithmetic runs in your browserResults update as you type
All calculations run 100% in your browser. The calculator code does not submit your figures to GlobalCalc to obtain a result.
About chi-square test

How the chi-square test calculator works

Under independence, the expected count in each cell is (row total × column total) ÷ grand total. Chi-square sums (observed − expected)² ÷ expected across the cells; a large value means the observed pattern is hard to explain by chance.

The test needs expected counts of at least 5 in every cell. Below that, use Fisher's exact test instead — the chi-square approximation stops being trustworthy.

Formula: χ² = Σ (O − E)² / E, df = (rows − 1)(cols − 1)

Worked examples

InputsChi-square statisticNote
45/55 against 30/704.8χ² = 4.76, p = 0.029
Identical proportions0χ² = 0
A small table1.607143expected counts too small — the gate warns

Frequently asked questions

What does the chi-square test tell me?

Whether the pattern in a contingency table is further from independence than chance would comfortably explain.

When is it not valid?

When any expected count falls below about 5. Then the approximation breaks down and Fisher's exact test is the right tool.

Should I use Yates' correction?

It is conservative and now generally discouraged for 2×2 tables — most statisticians prefer Fisher's exact test when the counts are small enough to worry about.

What is phi?

The effect size for a 2×2 table — √(χ²/n), which behaves like a correlation between two binary variables.

Does a significant chi-square show causation?

No. It shows association. The direction and the cause are questions the test cannot answer.

Where these figures come from

Last checked: September 2026. Formulas are fixed by mathematics and do not change with tax years or regulations.