Chi-Square Test Calculator
Calculate the chi-square test statistic from observed and expected frequencies. Used for goodness-of-fit tests and tests of independence in contingency tables across all fields of research.
This free online chi-square test calculator provides instant results with no signup required. All calculations run directly in your browser — your data is never sent to a server. Enter your values below and see results update in real time as you type. Perfect for everyday calculations, homework, or professional use.
Observed frequency for the first category.
Expected frequency for the first category.
Observed frequency for the second category.
Expected frequency for the second category.
How to Use This Calculator
Enter your input values
Fill in all required input fields for the Chi-Square Test Calculator. Most fields include unit selectors so you can work in your preferred unit system — metric or imperial, whichever matches your problem.
Review your inputs
Double-check that all values are correct and that you have selected the right units for each field. Incorrect units are the most common source of calculation errors and can produce results that are off by factors of 2, 10, or more.
Read the results
The Chi-Square Test Calculator instantly computes the output and displays results with units clearly labeled. All calculations happen in your browser — no loading time and no data sent to a server.
Explore parameter sensitivity
Try adjusting individual input values to see how the output changes. This is a quick and effective way to develop intuition about how different parameters influence the result and to identify which inputs have the largest effect.
Formula Reference
Chi-Square Test Calculator Formula
See calculator inputs for the governing equation
Variables: All variables and their units are labeled in the calculator interface above. Input fields accept values in multiple unit systems — select your preferred unit from the dropdown next to each field.
When to Use This Calculator
- •Use the Chi-Square Test Calculator when you need accurate results quickly without the risk of manual computation errors or unit conversion mistakes.
- •Use it to verify calculations made by hand or in spreadsheets — an independent check can catch errors before they lead to costly decisions.
- •Use it to explore how changing input parameters affects the output — a quick way to develop intuition and identify the most influential variables.
- •Use it when collaborating with others to ensure everyone is working from the same numbers and applying the same assumptions.
About This Calculator
The Chi-Square Test Calculator is a free, browser-based calculation tool for engineers, students, and technical professionals. Calculate the chi-square test statistic from observed and expected frequencies. Used for goodness-of-fit tests and tests of independence in contingency tables across all fields of research. It implements standard formulas and supports both metric (SI) and imperial unit systems with automatic unit conversion. All calculations are performed instantly in your browser with no data sent to a server. Use this calculator as a quick reference and sanity-check tool during design, analysis, and learning. Always verify results against primary engineering references and applicable standards for any safety-critical application.
About Chi-Square Test Calculator
The chi-square test calculator computes the chi-square statistic from observed and expected frequencies, which is then compared to critical values from the chi-square distribution to assess statistical significance. The chi-square test is one of the most commonly used nonparametric tests in statistics. It comes in two main forms: the goodness-of-fit test (testing whether observed data matches a theoretical distribution) and the test of independence (testing whether two categorical variables are related in a contingency table). It is used in genetics to test Mendelian ratios, in marketing to analyze survey responses, in epidemiology to compare disease rates, and in quality control to evaluate defect categories.
The Math Behind It
Formula Reference
Chi-Square Statistic
chi^2 = sum((O_i - E_i)^2 / E_i)
Variables: O_i = observed frequency; E_i = expected frequency; sum over all categories
Worked Examples
Example 1: Fair die test
A die is rolled 120 times with results: 25, 17, 22, 18, 20, 18 for faces 1-6. Expected: 20 each.
chi^2 = 2.6 with 5 df. Critical value at 5% is 11.07, so we fail to reject; the die appears fair.
Example 2: Gender and product preference
50 males and 30 females prefer Product A. Expected under independence: 40 and 40.
chi^2 = 5.0 with 1 df. Critical value at 5% is 3.841; result is significant.
Common Mistakes & Tips
- !Using the chi-square test with expected frequencies less than 5, which violates the approximation assumption.
- !Applying the test to percentages or means instead of raw counts.
- !Using the wrong degrees of freedom, which changes the critical value and conclusion.
Related Concepts
Used in These Calculators
Calculators that build on or apply the concepts from this page:
Frequently Asked Questions
What is the minimum expected frequency for the chi-square test?
A common rule is that all expected frequencies should be at least 5. When this is not met, combine categories or use Fisher's exact test.
Can I use chi-square for continuous data?
The chi-square test is designed for categorical (count) data. For continuous data, you would first need to bin the data into categories, but other tests like the t-test or ANOVA are usually more appropriate.
What is the difference between goodness-of-fit and independence tests?
Goodness-of-fit tests whether one variable's distribution matches a theoretical expectation. Independence tests whether two categorical variables are related in a contingency table.