HomeCalculatorsStatisticsChi-Square Test Calculator

Chi-Square Test Calculator

Statistics

Run a chi-square goodness-of-fit test in seconds. Enter up to six rows of observed vs expected frequencies to get the chi-square statistic and verdict.

Reviewed by the thecalcu.com team · Last updated August 2, 2026

Observed vs Expected Frequencies
ObservedExpected#1#2#3#4

Add up to 6 categories. At least 2 rows are required.

Chi-Square Statistic (χ²)

0

Degrees of Freedom

0

Critical (α=0.05)

0

Not Statistically Significant

No significant difference from the expected frequencies (fail to reject the null hypothesis).

What is a Chi-Square Test?

The Chi-Square Test Calculator runs a chi-square goodness-of-fit test, comparing a set of observed frequencies against a set of expected frequencies to determine whether the difference between them is statistically meaningful or just what you'd expect from random chance. Enter up to six rows of observed versus expected counts and the tool returns the chi-square statistic (χ²), the degrees of freedom, and the critical value at α = 0.05, giving you a clear pass/fail read on your hypothesis. This test shows up constantly in genetics, market research, quality control, and any field where you're checking whether real-world category counts match a theoretical or historical expectation. If your analysis involves comparing two continuous variables' means instead of categorical counts, the related T-Test Calculator is the better fit.

Show formula & methodology ↓Show less ↑

Formula & Methodology

χ² = Σ [(Oᵢ − Eᵢ)² / Eᵢ]

Where:
- χ² = chi-square statistic
- Oᵢ = observed frequency for category i
- Eᵢ = expected frequency for category i
- Σ = sum across all categories

Degrees of freedom = (number of categories − 1)

Worked example: Testing whether a six-sided die is fair after 60 rolls, with observed counts [8, 12, 9, 11, 10, 10] against expected counts of 10 for each face:

χ² = (8−10)²/10 + (12−10)²/10 + (9−10)²/10 + (11−10)²/10 + (10−10)²/10 + (10−10)²/10
χ² = 0.4 + 0.4 + 0.1 + 0.1 + 0 + 0 = 1.0

With df = 6 − 1 = 5, the critical value at α = 0.05 is 11.07. Since 1.0 is well below 11.07, we fail to reject the null hypothesis, this die looks fair based on this sample.

Why Use a Chi-Square Test Calculator?

Running this test by hand means squaring six deviations, dividing each by its expected value, summing them, then cross-referencing a chi-square distribution table for the critical value, plenty of steps where a single arithmetic slip changes your conclusion. This tool is built for two recurring situations: checking whether observed survey or experimental data matches a theoretical distribution (like testing die fairness, genetic ratios, or expected customer preference splits), and quickly verifying homework or research results without manually looking up critical values. Both come up often enough in coursework, lab work, and applied research that having instant, correct output matters.

How to use this Chi-Square Test calculator

  1. Add a row for each category in your data, up to six rows are supported.
  2. Enter the "Observed" frequency for each category, based on your actual collected data.
  3. Enter the "Expected" frequency for each category, based on your null hypothesis or theoretical distribution.
  4. Repeat for every category in your dataset, making sure observed and expected totals are reasonably close in scale.
  5. Review the "Chi-Square Statistic (χ²)" result, your primary output.
  6. Compare it against the "Critical Value (α = 0.05)" shown alongside "Degrees of Freedom" to determine whether to reject or fail to reject the null hypothesis.

Who Should Use This Chi-Square Calculator?

Statistics and biology students verifying genetics or survey homework problems can check their manual calculations against this tool's output. Market researchers testing whether observed customer category preferences match an assumed or historical distribution get a quick statistical read. Quality control analysts comparing defect category counts against a historical baseline can flag when a process has genuinely shifted versus normal variation. Researchers writing up categorical survey results need the chi-square statistic and degrees of freedom for their methods section. Genetics students and researchers testing observed inheritance ratios against Mendelian predictions rely on exactly this test as a standard first check.

Common Mistakes to Avoid

  • Using proportions instead of raw counts. The formula needs actual frequency counts (like 12 people), not percentages or proportions, converting incorrectly changes the statistic entirely.
  • Expected frequencies below 5. The chi-square approximation weakens when any expected category count drops under 5, with small samples, results should be interpreted cautiously or you should consider Fisher's exact test instead.
  • Forgetting degrees of freedom depends on category count, not sample size. Adding more total observations doesn't change df, only adding more categories does.
  • Confusing this test with a test of independence. Goodness-of-fit compares one variable's distribution to an expectation; testing whether two categorical variables relate to each other requires a contingency table approach instead.
  • Treating statistical significance as practical significance. A large enough sample can make even a trivial difference statistically significant, always sanity-check whether the actual size of the deviation matters in real terms.

For related statistical work, pair this with the Standard Deviation Calculator for spread analysis, or the Correlation Coefficient Calculator when you're checking relationships between two continuous variables instead of category counts.

Frequently Asked Questions

What's the difference between a goodness-of-fit test and a test of independence?
A goodness-of-fit test, which this calculator runs, checks whether a single set of observed frequencies matches an expected distribution across categories. A test of independence instead checks whether two categorical variables are related to each other using a contingency table, a different setup that this tool doesn't cover.
How do I know what my expected frequencies should be?
Expected frequencies come from whatever theoretical distribution or null hypothesis you're testing against, for a fair six-sided die rolled 60 times, you'd expect 10 of each face; for a genetic ratio, you'd expect frequencies matching the predicted Mendelian ratio. The expected values reflect what you'd see if there were no real effect, not what you actually observed.
What does it mean if my chi-square statistic exceeds the critical value?
It means you reject the null hypothesis at your chosen significance level, the observed frequencies differ from the expected frequencies by more than chance alone would plausibly explain. At α = 0.05, this represents less than a 5% probability that the observed deviation happened randomly if the null hypothesis were actually true.
Why does degrees of freedom equal categories minus 1?
Once you know the total sample size and all but one category's frequency, the last category's frequency is fully determined, it has no remaining freedom to vary. That's why degrees of freedom for a goodness-of-fit test is always (number of categories − 1), not the full category count.
Can I use this test with small sample sizes?
The chi-square approximation becomes unreliable when expected frequencies drop below about 5 in any category, with very small samples, consider Fisher's exact test instead, which doesn't rely on the same large-sample approximation. This calculator will still compute a result for small samples, but interpret it cautiously if any expected value is under 5.
What's a p-value and why isn't it shown directly here?
A p-value expresses the exact probability of observing your data (or more extreme) if the null hypothesis were true, while this calculator instead compares your statistic directly against the critical value at α = 0.05, a simpler pass/fail read at the most commonly used significance level. If you need the precise p-value, a chi-square distribution table or statistical software will give you the exact figure for your degrees of freedom.
Why do I need at least two categories for this test?
Chi-square goodness-of-fit inherently compares a distribution across multiple categories, with only one category there's nothing to distribute across, so the test is undefined. This calculator supports up to six rows of observed versus expected frequencies to accommodate most common use cases.
Does a significant chi-square result tell me which category is driving the difference?
Not directly, the overall statistic tells you the observed and expected distributions differ significantly somewhere, but not where. To pinpoint which specific category deviates most, look at the individual (observed − expected)²/expected contributions for each row before concluding which category matters most.
Is chi-square sensitive to sample size?
Yes, quite sensitive, with a large enough sample, even trivially small differences between observed and expected frequencies can produce a statistically significant chi-square statistic. Always consider practical significance (how big is the actual difference) alongside statistical significance when interpreting results.
What fields commonly use chi-square goodness-of-fit tests?
Genetics (testing observed inheritance ratios against Mendelian predictions), market research (testing whether customer preferences match an assumed distribution), and quality control (testing whether defect categories match historical baselines) are three of the most common applications. Anywhere you have categorical count data and a theoretical expectation to test it against, this test applies.
What critical value does this calculator use, and can I test at other significance levels?
This calculator reports the critical value at α = 0.05, the most widely used significance threshold in applied statistics. For α = 0.01 or 0.10, you'd need to look up the corresponding critical value from a chi-square distribution table using your calculated degrees of freedom.
Also known as
chi square testgoodness of fit test calculatorchi-square statistic calculatorobserved vs expected calculatorchi square distribution calculator