All Tools490+

Chi-Square Test Calculator – Test of Independence for Contingency Tables in 2 Easy Steps

Action successful! ✓

🔥 Chi-Square Test of Independence

Enter your observed frequencies below to calculate the Chi-Square statistic, Degrees of Freedom, and statistical significance.

Use this free chi-square test calculator to check whether two categorical variables are related, straight from a table of observed counts.

Quick answer

The chi-square test of independence compares observed counts with the counts you would expect if the two variables were unrelated. Expected = (row total × column total) / grand total and χ² = Σ (O − E)² / E, with df = (rows − 1)(columns − 1). Example: a 2 × 2 table of 30, 20 / 15, 35 gives χ² = 9.09 with df = 1. That is above the 0.05 critical value of 3.84, so the relationship is significant (p ≈ 0.003).

Chi-square is the standard test for counts in categories: does product preference depend on age group, is pass rate linked to teaching method, do click-through rates differ by ad version? Any time your data are frequencies in a table, this is the test to reach for.

Calculating expected counts and summing (O − E)² / E for every cell is tedious. Our chi-square test calculator builds the grid for any number of rows and columns and returns the statistic, degrees of freedom and a clear significance verdict.

Chi-Square Test Formula

Eᵢⱼ = (row i total × column j total) / grand total
χ²  = Σ (Oᵢⱼ − Eᵢⱼ)² / Eᵢⱼ
df  = (rows − 1) × (columns − 1)

O is the observed count and E the expected count for each cell. The bigger the gap between observed and expected counts, the larger χ² becomes and the stronger the evidence that the variables are related.

Worked Example: 2 × 2 Table

100 customers were asked whether they prefer Plan A or Plan B, split by new and returning customers.

Plan APlan BTotal
New302050
Returning153550
Total4555100
  1. Expected counts: New/Plan A = 50 × 45 / 100 = 22.5, New/Plan B = 27.5, Returning/Plan A = 22.5, Returning/Plan B = 27.5.
  2. χ² = (30 − 22.5)²/22.5 + (20 − 27.5)²/27.5 + (15 − 22.5)²/22.5 + (35 − 27.5)²/27.5 = 9.09.
  3. df = (2 − 1)(2 − 1) = 1. The critical value at α = 0.05 is 3.84.
  4. Because 9.09 > 3.84, plan choice is significantly related to customer type (p ≈ 0.003).

Worked Example: 2 × 3 Table

Observed counts of 20, 30, 50 in the first row and 30, 25, 15 in the second give χ² = 16.52 with df = 2. The 0.05 critical value for df = 2 is 5.99, so the result is significant (p ≈ 0.0003).

How to Use the Chi-Square Test Calculator

Step 1: Set Up the Table and Enter Observed Counts

Enter the number of Rows and Columns, choose the Significance Level (α) of 0.01, 0.05 or 0.10, and click Update Table Grid. Type the observed count for each cell, then click Calculate Chi-Square.

Step 1 set rows, columns and significance level, then enter observed counts in the chi-square test calculator

Step 2: Read χ², Degrees of Freedom and Significance

The Statistical Results panel shows the chi-square statistic, the degrees of freedom, whether p is below or above your α, and a label saying whether there is a significant relationship. Use Copy Results, Download CSV or Share Tool.

Step 2 read chi-square statistic, degrees of freedom, p-value and significance result

Critical Values of Chi-Square

dfα = 0.10α = 0.05α = 0.01
12.7063.8416.635
24.6055.9919.210
36.2517.81511.345
47.7799.48813.277
610.64512.59216.812

If your χ² is larger than the value for your df and α, the result is significant.

Assumptions and Conditions

  • Counts, not percentages: enter raw frequencies. Percentages or means give wrong results.
  • Independent observations: each person or item is counted in one cell only.
  • Expected counts: every expected count should be at least 1, and at least 80% should be 5 or more. For small 2 × 2 tables, use Fisher’s exact test instead.
  • No continuity correction: the calculator reports the standard Pearson χ². Some textbooks apply Yates’ correction for 2 × 2 tables, which gives a slightly smaller value (7.92 for the example above).

How to Report a Chi-Square Result

Write the statistic with its degrees of freedom, sample size and p-value, for example: “A chi-square test of independence showed a significant relationship between customer type and plan choice, χ²(1, N = 100) = 9.09, p < .05.”

Common Mistakes

  • Entering percentages instead of counts.
  • Counting the same person in more than one cell.
  • Using chi-square with many expected counts below 5.
  • Concluding cause and effect from a significant association.

Frequently Asked Questions

What does a chi-square test calculator do?

It takes a table of observed counts, works out the expected counts and returns the chi-square statistic, degrees of freedom and whether the two variables are significantly related.

How do you calculate degrees of freedom for chi-square?

Multiply (number of rows − 1) by (number of columns − 1). A 3 × 4 table has 2 × 3 = 6 degrees of freedom.

What is a significant chi-square value?

It depends on the degrees of freedom. For df = 1 at α = 0.05, any χ² above 3.841 is significant.

Can I use percentages in a chi-square test?

No. Always enter raw counts. Percentages change the sample size and give wrong results.

Does the calculator use Yates’ correction?

No. It reports the standard Pearson chi-square without continuity correction.

Is this chi-square calculator free?

Yes. It is free, runs in your browser and needs no sign-up.

MH

Written and tested by Muhammad Hasnain

Founder of VectraTools. Behaviour described here was checked against the tool’s own output. Last reviewed: October 2026.