📊Chi-Square Test Calculator

Run goodness-of-fit and independence tests with full per-cell working.

Enter observed and expected frequencies (one row per category)

Free Chi-Square Test Calculator

Testing whether your data fits an expected pattern, or whether two categorical variables are related? Our free chi-square test calculator handles both goodness-of-fit and independence (contingency table) tests, giving you the chi-square statistic, degrees of freedom, and p-value instantly.

For goodness-of-fit, enter your observed and expected frequencies; for independence, build a contingency table and the expected frequencies are calculated automatically from the row and column totals. Every cell's contribution to the chi-square statistic is shown, so you can see exactly where the biggest deviations come from, not just the final number.

Built for statistics coursework, survey analysis, and research. No sign-up, no downloads, completely free.

About the Chi-Square Test Calculator

Features

Two test modes

Goodness-of-fit and independence, each with its own input layout.

Dynamic contingency table

Flexible row and column counts for common table sizes.

Per-cell working

Every category or cell's contribution to χ² shown individually.

Accurate p-value

Computed from the chi-square distribution CDF across arbitrary degrees of freedom.

Frequently Asked Questions

What's the difference between goodness-of-fit and independence tests?

Goodness-of-fit checks whether observed frequencies match an expected distribution; independence checks whether two categorical variables are related, using a contingency table.

How is the chi-square statistic calculated?

By summing (observed − expected)² / expected across all categories or cells.

How are expected frequencies found in an independence test?

From (row total × column total) / grand total for each cell, computed automatically from your entered data.

How are degrees of freedom determined?

k − 1 for goodness-of-fit with k categories; (rows − 1) × (columns − 1) for an independence test.

What does a significant result mean?

For goodness-of-fit, that observed data significantly deviates from the expected distribution; for independence, that the two variables are likely related, not independent.

What size contingency table can I use?

The tool supports flexible row/column counts for common table sizes.

What if an expected frequency is zero?

Expected frequencies must be greater than zero for the chi-square formula to be valid; the calculator flags this case.

Does it show the per-cell working?

Yes, each category or cell's contribution to the chi-square statistic is shown individually.

Is my data stored?

No, everything runs client-side in your browser.

Is it free?

Yes, completely free with no sign-up or limits.