DoesWhatAnswersSlangEmojisCalculatorsTriviaPlayBlog

Trivia Questions and Weird Facts

Statistics

Chi-Square Calculator

Does the distribution of one categorical variable change across another? Paste a contingency table of observed counts to run an uncorrected Pearson chi-square test of independence. The result includes expected counts, a p-value and a warning when small cells weaken the approximation.

Loading the calculator. It runs in your browser, so JavaScript needs to be on.

How to use the Chi-Square Calculator

  1. Enter Observed counts with one row per category of the first variable and one column per category of the second.
  2. Separate columns with commas or spaces and rows with new lines or semicolons. Enter actual counts, not percentages or row totals.
  3. Use 2 to 20 rows and 2 to 20 columns. Every row must have the same number of columns, and each row and column needs a positive total.
  4. Choose Significance level, then compare the p-value and decision. Inspect the expected-count table and low-count warning before interpreting the test.

The formula

Expected count Eij = row total i times column total j / grand total. Pearson chi-square = sum of (Oij - Eij) squared / Eij over all cells. Degrees of freedom = (rows - 1)(columns - 1). The p-value is the chi-square right-tail probability. Cramer V = square root of [chi-square / (total observations times min(rows - 1, columns - 1))]. No Yates continuity correction is applied.

Worked example

Enter rows 20, 30 and 30, 20. Each row and column totals 50, so every expected count is 25. The four contributions are each 25/25 = 1, giving chi-square = 4 with 1 degree of freedom. The p-value is approximately 0.0455, so independence is rejected at 5%. Cramer V is 0.2.

A small p-value concerns association

The null hypothesis says the two categorical variables are independent. A p-value below your chosen threshold is evidence against that hypothesis, under the test assumptions. It is not the probability that independence is true and does not measure the size of the association. With many observations, a small difference can produce a small p-value; Cramer V adds a dimensionless effect-size summary.

Small expected counts need care

The expected table is calculated under independence, so an observed zero does not automatically invalidate the test. Small expected counts are the concern. The calculator flags every expected count below 5. For sparse tables, an exact test may be more appropriate. Combining categories should follow their substantive meaning, not a desire to change the p-value.

Each observation belongs in one cell

Rows and columns should describe mutually exclusive categories, and observations should be independent. Repeated responses from the same person can violate this assumption. A 2 by 3 table has 2 degrees of freedom; a 3 by 3 table has 4. The right-tail calculation uses the chi-square distribution. A result labeled do not reject independence means insufficient evidence against independence, not proof of it.

Chi-Square Calculator questions

Can I use percentages in a chi-square test?

Use counts, not percentages. Sample size affects the statistic, and percentages alone lose that information.

Does this use Yates correction?

No. It uses the uncorrected Pearson statistic for all supported table sizes, including 2 by 2 tables.

What does a p-value above 0.05 mean?

At a 5% significance level, it means this test does not provide enough evidence to reject independence. It does not establish that the variables have no association.

Related calculators