Chi-Square Calculator
Use this free online chi-square calculator to run a goodness-of-fit test from observed and expected frequencies. Enter up to 4 categories to get the chi-square statistic, degrees of freedom, and p-value with a clear interpretation.
Enter Values
Actual count in category 1
Actual count in category 2
Actual count in category 3
Actual count in category 4
Expected count if null hypothesis is true
Expected count for category 2
Expected count for category 3
Expected count for category 4
Result
Enter values above and click Calculate to see your result.
AI Assistant
Ask about this calculator
I can help you understand the chi-square calculator formula, interpret your results, and answer follow-up questions.
Try asking
Formula
How it works: For each category, subtract the expected from the observed, square the difference, divide by expected. Sum across all categories. Larger values mean greater deviation from expected.
Review and Methodology
This calculator runs locally in your browser. Inputs are converted into the units required by the formula, and the result is paired with supporting references so you can verify the method before using it for planning or estimates.
Worked Example
What Is the Chi-Square Goodness-of-Fit Test?
The chi-square goodness-of-fit test determines whether observed frequency data matches an expected distribution. It answers: "Do these observed counts differ from expected by more than random chance?"
- Common uses: testing die fairness, survey distributions, genetic ratios
- The test statistic is always non-negative because differences are squared
- Degrees of freedom = number of categories minus 1 (df = k - 1)
- Rule of thumb: all expected counts should be at least 5 for the approximation to be reliable
- The chi-square test is one-tailed (right-tailed) because only large values indicate poor fit
The chi-square test is non-parametric and widely used in genetics, quality control, market research, and social sciences.
You can also calculate changes using our Degrees of Freedom Calculator, Test Statistic Calculator, F-Test Calculator or T-Test Calculator.
Frequently Asked Questions
What does the chi-square test check?
It checks whether observed frequencies differ from expected frequencies by more than random chance. A significant result means the observed distribution does not match the expected one.
Can expected counts be zero?
No. Expected values must be positive because the formula divides by E. The general rule is all expected counts should be at least 5.
What is the difference between goodness-of-fit and independence tests?
Goodness-of-fit tests one variable against an expected distribution. Independence tests whether two categorical variables are related using a contingency table.
How do I test whether a die is fair?
Roll the die many times and record counts for each face. Expected = total rolls / 6 for each face. If p-value is below alpha, the die is likely unfair.
What if expected counts are less than 5?
The chi-square approximation becomes unreliable. Options: combine categories, use Fisher's exact test for 2x2 tables, or use exact multinomial tests.
Can I use chi-square for continuous data?
Not directly. Chi-square requires categorical count data. For continuous data, consider the Kolmogorov-Smirnov or Shapiro-Wilk tests.
How can I put this Chi-Square Calculator on my blog or website?
Yes, the Chi-Square Calculator is fully embeddable. Tap "Embed" above to configure appearance and copy the code. It is free to use, works on any platform (HTML, WordPress, CMS), and adjusts to any screen size automatically. Visit calculory.com/services/embed-calculators for the complete guide.
AI Assistant
Ask about this calculator
I can help you understand the chi-square calculator formula, interpret your results, and answer follow-up questions.
Try asking
More Statistics Calculators
View allRelated Articles
All articles
Types of Calculators in 2026: A Complete Guide to Choosing the Right One
Every type of calculator explained: basic, desk, scientific, graphing, printing, financial, construction (Sonic Cal style), online, app, and voice. Pick the right one in under a minute.
Read article
Best Voice Calculators in 2026: Online Tools and Mobile Apps Compared
The best voice calculators of 2026 compared: web tools, iPhone and Android apps, talking calculators, and PC options. Find the right voice activated calculator.
Read article
Seattle Sales Tax vs NYC, Chicago, LA, and SF: 2026 Guide
Seattle's sales tax is 10.25% in 2026, tied with Chicago and LA for the highest of any major US city. See how it stacks up against NYC, SF, Houston, and Portland.
Read article
Agentic ROI Blueprint: Replacing Roles in 2026
In 2026, teams are measuring total capability, not just headcount. Learn how to model the cost of replacing or augmenting full-time roles with an AI agent stack.
Read articleAccurate and Reliable
All calculations run locally. Trusted statistical analysis with step-by-step breakdowns.
Verified Precision
Precise Statistical Calculations Powered by Calculory AI