# Chi-Square Test Calculator

Free chi-square test calculator. Calculate the chi-square statistic, degrees of freedom, and p-value from observed and expected frequencies.

## What this calculates

Perform a chi-square goodness-of-fit test by entering observed and expected frequencies for up to 4 categories. Get the test statistic, degrees of freedom, and approximate p-value.

## Inputs

- **Observed Frequency 1** — min 0 — Observed count for category 1.
- **Expected Frequency 1** — min 0.001 — Expected count for category 1.
- **Observed Frequency 2** — min 0 — Observed count for category 2.
- **Expected Frequency 2** — min 0.001 — Expected count for category 2.
- **Observed Frequency 3** — min 0 — Observed count for category 3 (optional, enter 0 to skip).
- **Expected Frequency 3** — min 0 — Expected count for category 3.
- **Observed Frequency 4** — min 0 — Observed count for category 4 (optional, enter 0 to skip).
- **Expected Frequency 4** — min 0 — Expected count for category 4.

## Outputs

- **Chi-Square Statistic (χ²)** — The calculated chi-square test statistic.
- **Degrees of Freedom** — Number of categories minus 1.
- **Approximate P-Value** — Approximate p-value for the test.
- **Significant at α = 0.05?** — formatted as text — Whether the result is statistically significant.
- **Calculation** — formatted as text — Step-by-step chi-square calculation.

## Details

The chi-square test measures how well observed data matches expected data.

Formula

χ² = Σ (Oᵢ - Eᵢ)² / Eᵢ

Where Oᵢ = observed frequency and Eᵢ = expected frequency for each category.

Degrees of freedom = number of categories - 1

A larger χ² value indicates a greater discrepancy between observed and expected. Compare the p-value to your significance level (typically 0.05) to determine statistical significance.

## Frequently Asked Questions

**Q: What is the chi-square test used for?**

A: The chi-square test is used to determine if there is a significant difference between observed and expected frequencies in categorical data. Common applications include testing if a die is fair, checking if survey responses match expected distributions, and testing for independence between two categorical variables.

**Q: What are the assumptions of the chi-square test?**

A: The chi-square test assumes: (1) observations are independent, (2) categories are mutually exclusive, (3) expected frequency in each category is at least 5. If expected frequencies are too small, consider combining categories or using Fisher's exact test.

**Q: How do I interpret the p-value?**

A: If p < 0.05 (at the 5% significance level), reject the null hypothesis -- the observed data significantly differs from expected. If p >= 0.05, there is insufficient evidence to conclude the data differs from expected.

---

Source: https://vastcalc.com/calculators/statistics/chi-square
Category: Statistics
Last updated: 2026-04-21
