# Chi-Square Goodness of Fit Calculator

> Test whether observed counts match expected proportions: Pearson’s χ² statistic, degrees of freedom, right-tailed p-value, critical value and each category’s share.

Category: Statistics & probability · Applies to: Worldwide · Last updated: 2026-10-29
Interactive calculator: https://calculators.geekmidst.com/calculators/chi-square-goodness-of-fit-calculator

The chi-square goodness-of-fit test asks whether counts in categories are consistent with a set of expected proportions, such as a fair die, a genetic ratio or a planned market share.

Also called: Chi-square test for given proportions, Pearson chi-square test.

## Inputs
- Observed counts (default 315, 108, 101, 32)
- Expected counts or ratios (optional) (default 9, 3, 3, 1; optional)
- Parameters estimated from the data (default 0; optional)
- Significance level (α) (unit %; default 5)

## Results
- χ² statistic
- Degrees of freedom
- p-value (right-tailed)
- p-value, full precision
- Critical value at α
- Decision
- Smallest expected count

## Formula

```
χ² = Σ (O − E)² ÷ E;  df = categories − 1 − estimated parameters;  p = P(χ²_df ≥ observed χ²)
```

Where:
- O: observed count in a category
- E: expected count = total × expected proportion
- df: degrees of freedom

## Worked example
1. Total = 556. Expected for 9:3:3:1 = 312.75, 104.25, 104.25, 34.75.
2. χ² = 2.25²/312.75 + 3.75²/104.25 + 3.25²/104.25 + 2.75²/34.75 = 0.016 + 0.135 + 0.101 + 0.218 = 0.470.
3. With 3 degrees of freedom, P(χ² ≥ 0.470) = 0.925, far above 0.05; the 5% critical value is 7.815.

**Result:** Mendel’s pea counts fit the 9:3:3:1 ratio very well: χ² = 0.47 with 3 df, p = 0.93.

## What the result means

A small p-value means the counts are unlikely under the expected proportions. A large p-value does not prove the proportions are right, only that the data cannot rule them out. The table shows which categories contribute most to the statistic.

## Assumptions and limits
- Observations are independent and each falls into exactly one category.
- Expected counts are at least 5 in every category (a common rule for the chi-square approximation).
- The test is right-tailed: only large χ² values count against the null hypothesis.
- Enter raw counts, not percentages or averages; the statistic depends on the actual sample size.
- For small expected counts use an exact multinomial test or merge categories.

## Questions

### How many degrees of freedom?

Categories minus one, minus one more for each parameter you estimated from the same data to build the expected counts.

### Is this the same as the chi-square test of independence?

No. Independence uses a two-way table and df = (rows − 1)(columns − 1). This test compares one set of counts with fixed proportions.

## Related calculators
- [P-value Calculator](https://calculators.geekmidst.com/calculators/p-value-calculator)
- [Binomial Probability Calculator](https://calculators.geekmidst.com/calculators/binomial-probability-calculator)
- [Statistics Calculator](https://calculators.geekmidst.com/calculators/statistics-calculator)

Source: GM¹X CalcVerse — https://calculators.geekmidst.com/calculators/chi-square-goodness-of-fit-calculator
