What is Chi-Square Calculator?
Chi-Square Calculator performs chi-square goodness-of-fit and independence tests with full statistical output. Enter observed and expected frequencies, and get the chi-square statistic, degrees of freedom, p-value, and Cramer's V effect size. Includes a visual chi-square distribution curve showing your result.
The tool runs both flavours of the test on the same screen: goodness-of-fit when you have one categorical variable with predicted frequencies, and independence when you have a contingency table of two variables. Output includes the chi-square statistic, degrees of freedom, p-value, critical value at α 0.01, 0.05, or 0.10, and Cramer's V effect size for independence tables. A distribution curve plots your statistic against the critical region so you can see at a glance whether the result lands in the reject zone.
How to use
- Choose your test type: Goodness of Fit (one variable vs expected distribution) or Test of Independence (two categorical variables in a contingency table).
- Enter your observed frequencies in the table cells. For goodness of fit, also enter expected frequencies. For independence, the expected values are calculated automatically.
- Click Calculate to see the chi-square statistic, degrees of freedom, p-value, and whether to reject the null hypothesis at your chosen significance level (0.01, 0.05, or 0.10).
When to use
- Checking whether a dice roll or random sample matches a uniform distribution.
- Testing if two categorical variables (e.g. gender vs product preference) are related.
- A/B testing more than two variants where t-tests aren't appropriate.
Result
A marketer tests whether 4 ad variants perform equally. Observed clicks: A=142, B=186, C=121, D=151. Expected: 150 each. The chi-square test yields X2=14.2, df=3, p=0.0026 — significant difference, Variant B wins.
FAQ
- When should I pick goodness-of-fit over independence?
- Use goodness-of-fit when you have one categorical variable with observed counts and a known or predicted distribution to compare against. Use independence when you have two categorical variables in rows and columns and want to know if they move together.
- What does Cramer's V tell me that the p-value doesn't?
- P-value tells you whether the association is statistically significant; Cramer's V tells you how strong it is, scaled 0 to 1. With large samples you can get a tiny p-value on a relationship so weak it's not meaningful. V under 0.1 is negligible, 0.1–0.3 small, 0.3–0.5 medium, above 0.5 large.
- Are my results valid if some expected cell counts are below 5?
- The chi-square approximation gets shaky when expected frequencies drop under 5. Most textbooks require at least 80% of cells to have expected counts above 5 and none below 1. If you violate that, merge sparse categories or switch to Fisher's exact test.
- What significance level should I use?
- 0.05 is the convention in most social science and marketing work. Choose 0.01 when a false positive is costly (medical, regulatory). 0.10 is sometimes used for exploratory pilots where you'd rather investigate further than miss a real effect.
- Why does the test return df = (rows-1) × (cols-1)?
- For an independence table, once row totals and column totals are fixed, only (r-1)(c-1) cells are free to vary — the rest are determined by the totals. That count of free parameters is the degrees of freedom that anchors the chi-square distribution.
Related Tools
Regression Calculator
Perform linear and polynomial regression analysis
Matrix Calculator
Perform matrix operations and calculations
Graphing Calculator
Plot mathematical functions on a graph
Area Calculator Map
Draw shapes on a map to calculate area
Z-Score Calculator
Calculate z-scores, percentiles, and probabilities
Number Base Converter
Convert between binary, octal, decimal, hex