Chi-Square (Chi Cuadrado) Goodness-of-Fit Calculator
Use this tool to calculate a χ2 statistic, degrees of freedom, and p-value from observed and expected frequencies.
| Category | Observed (O) | Expected (E) |
|---|
Tip: Expected values must be positive. For many applications, at least 80% of expected counts should be 5 or more.
What is a chi cuadrado calculator?
A chi cuadrado calculator helps you run a chi-square test quickly and accurately. In statistics, the chi-square test compares observed data to what you would expect under a hypothesis. It is widely used in business analytics, social science, education, quality control, and A/B test diagnostics.
This page focuses on the chi-square goodness-of-fit test, where you compare one set of observed frequencies against expected frequencies across categories.
How the chi-square statistic is computed
The core formula is:
χ2 = Σ ((O - E)2 / E)
- O = observed count in a category
- E = expected count in that category
The calculator sums that contribution for every category, then computes:
- Degrees of freedom (df) = number of categories - 1
- p-value from the chi-square distribution with that df
How to use this calculator
- Set how many categories you have and click Build Table.
- Enter observed values from your sample.
- Enter expected values from your null hypothesis.
- Choose your significance level, commonly 0.05.
- Click Calculate Chi-Square to get the test result.
If your expected totals do not match observed totals, you can leave auto-scaling enabled so the expected counts are proportionally adjusted.
Interpreting the result
Key outputs
- χ2 statistic: larger values generally indicate larger differences from expectation.
- df: shape parameter for the chi-square distribution.
- p-value: probability of observing differences this large (or larger) if the null hypothesis is true.
Decision rule
If p-value < α, reject the null hypothesis. If not, you fail to reject it. Failing to reject does not prove the null is true; it means your data does not provide strong enough evidence against it.
Common assumptions and mistakes
- Counts should be independent observations.
- Data must be frequencies (counts), not percentages directly.
- Expected values should generally not be too small.
- The categories should be mutually exclusive and collectively exhaustive.
A common mistake is entering probabilities as expected counts. If you only have probabilities, multiply them by the sample size first.
Example use case
Suppose a store expects product preferences in a 40/30/20/10 split, and records 200 customers. Convert those expectations to counts (80, 60, 40, 20), enter observed counts from actual purchases, and compute the chi-square test. The calculator then tells you if deviations are likely due to random chance or indicate a real shift in preferences.
Final note
This tool is built for goodness-of-fit analysis. If you need a chi-square test of independence (for contingency tables), use a dedicated cross-tab chi-square calculator. For many day-to-day tasks, however, this version is fast, practical, and easy to audit because it shows each category’s contribution.