About this tool
The Chi-Square Test Calculator is a free, in-browser tool that runs a chi-square test of independence on a two-way contingency table of observed counts. Paste or type the table — one row per line, values separated by spaces or commas — and it computes the expected count for every cell, the χ² statistic Σ(O−E)²/E, the degrees of freedom (rows − 1)(columns − 1) and the right-tailed p-value from the chi-square distribution.
The expected-counts table is displayed so you can check the test's assumptions, and a warning appears when any expected count falls below 5, the usual rule-of-thumb threshold. The p-value is computed with the regularized incomplete gamma function to table accuracy, entirely in your browser — your data never leaves your device.
Frequently asked questions
How do I enter my table?
One line per row of the table, with the counts in each line separated by spaces, commas, semicolons or tabs. The table must be rectangular with at least 2 rows and 2 columns of non-negative counts.
How are the expected counts calculated?
Each cell's expected count is (row total × column total) ÷ grand total — the counts you would see if the row and column variables were perfectly independent. χ² measures how far the observed counts deviate from these.
What does the expected-count warning mean?
The chi-square approximation is unreliable when expected counts are small; the common rule is that all (or at least 80% of) expected counts should be ≥ 5. For small 2×2 tables consider Fisher's exact test instead.
Is the p-value one-tailed or two-tailed?
It is the right-tailed probability P(χ² ≥ observed), which is the standard p-value for independence and goodness-of-fit tests — large χ² values indicate disagreement with independence, so only the upper tail is relevant.
More tools