Chi-Square Test screenshot

Chi-Square Test

Pearson's test of independence on a contingency table, with expected counts and Cramer's V.

Privacy First
0 Runs
Updated 2026-11-06
No upload
Runs in this tab
No signup

What this page computes

Put one table row per line with the cell counts comma-separated. Expected counts are E = (row total × column total)/N; the statistic is χ² = Σ(O − E)²/E on (rows − 1)(columns − 1) degrees of freedom; and the p-value is the upper tail of the chi-square distribution, computed as an incomplete gamma function. The page prints the statistic, df, the upper-tail p, every expected count and Cramer's V. Figures print to six significant figures.

The test assumes independent observations and adequate expected counts; the page counts how many expected values fall below 5 and says so rather than hiding it. Negative cells, an all-zero row or column, and a table smaller than two by two are refused by name.

The table is read in your browser and never uploaded, so the same counts always give the same statistic.

The page runs Pearson’s chi-square test of independence on a contingency table you paste: expected counts E = (row total × column total)/N, χ² = Σ(O − E)²/E, degrees of freedom (rows − 1)(columns − 1), and a p-value from the upper tail of that chi-square. The two-by-three table 10, 20, 30 over 15, 25, 20 gives χ² = 3.55556 on 2 degrees of freedom and p = 0.169013. Cramér’s V is printed beside it so the size of the association is visible, not just its significance.

Test two categorical variables for association from a pasted contingency table. The p-value is the upper tail, and the degrees of freedom are printed.

How to use it

Paste one table row per line, with the counts comma-separated — this page reads a table, not a single column. It needs at least two rows and two columns, and every row must have the same number of columns; a ragged table is refused rather than padded. The expected counts are printed under the result so you can see whether any of them drops below 5, which is the usual condition for trusting the p-value, and the page says so in words when it does.

The tail, the degrees of freedom and Cramér’s V

The statistic compares each observed count with the count independence would predict for that cell, so a large χ² means the table’s rows and columns are not independent. The p-value is the upper tail of χ² with (rows − 1)(columns − 1) degrees of freedom — never a one-tailed or two-tailed choice, because this test has only one tail. Cramér’s V = √(χ²/(N·min(rows − 1, columns − 1))) rescales the same statistic to 0 … 1 so tables of different sizes can be compared.

What to Expect

Best for

  • Checking whether two categorical variables look associated

What this tool keeps

  • Nothing leaves this tab: the arithmetic runs in the page you are reading, and a reload discards both the input and the result.

Sample input

10, 20, 30 15, 25, 20

Sample output

χ² = 3.55556, df = 2, p = 0.169013 (upper tail, H₁: the two variables are associated) N = 120, Cramér’s V = 0.172133 expected counts: 12.5 22.5 25 12.5 22.5 25 every expected count is 5 or more, which is the usual condition for this test.

Frequently asked questions

Which tail is the p-value from?

The upper tail of the chi-square distribution with (rows − 1)(columns − 1) degrees of freedom, and both the statistic and the df are printed on the result line. A chi-square test of independence has no second tail to choose.

How is the table entered?

One table row per line, with that row’s counts comma-separated. Every line must carry the same number of counts; a ragged table is refused by line rather than padded with zeros.

Is my table uploaded?

No. The expected counts, the statistic and the p-value are computed in this page, so the table never leaves the tab and is not stored.

Developer program

Build custom tools for your store

Join the SDK program to create useful ecommerce utilities for your store.