Mathematics, Statistics & Geometry

Chi-Square Test Calculator

Perform a Chi-Square Goodness-of-Fit test instantly. Compare observed and expected frequencies to calculate χ², degrees of freedom, and p-value.

Chi-Square Statistic (χ²)
2
Degrees of Freedom3
P-Value0.576
Calculation StepsObserved (O): 30, 20, 25, 25 Expected (E): 25, 25, 25, 25 Formula: χ² = Σ [ (O - E)² / E ] Term 1: (30 - 25)² / 25 = 1.0000 Term 2: (20 - 25)² / 25 = 1.0000 Term 3: (25 - 25)² / 25 = 0.0000 Term 4: (25 - 25)² / 25 = 0.0000 χ² = 2.0000, df = 3 P-Value ≈ 0.576258

Calculated locally in your browser. Fast, secure, and private.

Validating Theoretical Models

The Chi-Square Test Calculator (Goodness-of-Fit) is an indispensable tool for researchers, biologists, and marketers. It allows you to statistically verify if your real-world data aligns with theoretical expectations or if the deviations are too large to be attributed to random chance.

χ2=(OiEi)2Ei\begin{aligned} \chi^2 = \sum \frac{(O_i - E_i)^2}{E_i} \end{aligned}

Where:
χ2\chi^2=
The calculated test statistic
OiO_i=
The actual frequency observed in the data
EiE_i=
The theoretical frequency expected under the null hypothesis

Common Use Cases

  • Genetics: Verifying if the traits of offspring match Mendelian inheritance ratios (e.g., 9:3:3:1).
  • Marketing: Testing if customer preferences across 4 different product flavors match an expected uniform distribution.
  • Gaming & Casinos: Checking if a roulette wheel or pair of dice is fair or biased.

How to Format Your Data

To use this calculator, you must provide two lists of numbers:

  1. Observed Values: The raw counts or frequencies you actually recorded.
  2. Expected Values: The raw counts you expected to see.

Note: You must enter frequencies (counts), not percentages or probabilities. The total sum of the observed list should ideally equal the total sum of the expected list.

Interpreting the Results

The calculator will output a P-Value based on the χ² distribution. If your p-value is less than your significance level (usually 0.05), you reject the null hypothesis. This means there is a significant difference between your observed data and the expected model.

Frequently Asked Questions

It is a statistical test used to determine if sample data matches a population with a specific distribution. For example, checking if a die is fair by comparing observed rolls to the expected uniform distribution.

For each category, subtract the expected value from the observed value, square the result, and divide by the expected value. Then sum these values for all categories.

A low p-value (typically < 0.05) indicates that the difference between observed and expected data is statistically significant, meaning the data does not fit the expected model.

No. The Chi-Square formula requires dividing by the expected value. If an expected value is zero, the test cannot be performed (division by zero is undefined).

For a Goodness-of-Fit test, the degrees of freedom (df) is the number of categories minus one (n - 1).