Statistics & Probability

Verified calculator with a transparent formula

Statistics & Probability

Chi-Square Statistic Calculator.

Calculates the chi-square statistic for a contingency table or goodness-of-fit test based on observed and expected frequencies.

Results update live as you type.
ƒ

Your inputs

How it works

  1. 1

    Enter the observed frequency for a category.

  2. 2

    Enter the expected frequency for that category.

  3. 3

    The calculator computes (observed - expected) squared divided by expected.

  4. 4

    The result is the chi-square contribution for that cell.

((observed - expected)^2) / expected

Frequently asked questions

What does the chi-square statistic measure?

It measures the discrepancy between observed and expected frequencies. A larger value indicates a bigger difference.

Can I use this for multiple categories?

This calculator handles one cell at a time. For a full test, sum the contributions from all cells.

What if the expected frequency is zero?

Expected frequencies should be greater than zero. The calculator uses a minimum of 0.0001 to avoid division by zero.

Explore this calculator category

Results

Formula checked

Chi-square statistic

0

Ask Anything

Estimate for general guidance only — verify important decisions with an appropriate professional.

How it works

Calculates the chi-square statistic for a contingency table or goodness-of-fit test based on observed and expected frequencies.

  1. Enter the observed frequency for a category.
  2. Enter the expected frequency for that category.
  3. The calculator computes (observed - expected) squared divided by expected.
  4. The result is the chi-square contribution for that cell.

Formulas

The math behind this calculator, written out so you can verify the result.

Chi-square contribution

χ² = (O - E)² / E

For each category, subtract the expected frequency from the observed, square the difference, and divide by the expected frequency.

Example:

Input: O = 50, E = 40

Calculation: (50 - 40)² / 40 = 100 / 40

Result: 2.5

Real-world use cases

Where this calculation shows up in everyday life.

Goodness-of-fit test

Compare observed counts to expected counts from a theoretical distribution.

Example: Testing if a die is fair.

Test of independence

Assess whether two categorical variables are related in a contingency table.

Example: Checking if gender affects product preference.

Homogeneity test

Compare the distribution of a categorical variable across different populations.

Example: Comparing survey responses across age groups.

Tips and common mistakes

Tips

  • Ensure expected frequencies are at least 5 for validity in many tests.
  • Sum the contributions from all cells to get the total chi-square statistic.
  • Use the degrees of freedom to determine the p-value from a chi-square distribution table.

Common Mistakes to Avoid

  • Using percentages instead of raw frequencies.
  • Forgetting to square the difference between observed and expected.
  • Dividing by observed instead of expected.

Assumptions and limitations

  • Use the stated inputs and units.
  • Results are estimates for planning and education.
  • Check measurements and source data before making an important decision.