Chi Square Calculator
Enter observed and expected counts to instantly compute the chi-square statistic, degrees of freedom, and p-value.
χ² = Σ (O − E)² ÷ E, added up over every cell.
Use the Chi Square Calculator
Test Configuration
Leave Expected blank to assume equal distribution.
Enter observed counts — expected values are computed automatically.
Enter your data and click Calculate to see results.
Cell Breakdown
| Cell | Observed | Expected | (O−E)²/E |
|---|
Quick answer
χ² = Σ (O − E)² ÷ E, added up over every cell. Degrees of freedom are categories − 1 for a goodness-of-fit test and (rows − 1) × (columns − 1) for a contingency table, and the p-value is the upper-tail chi-square probability. Getting 60 heads in 100 coin flips gives χ² = 4.0000 with 1 df and p = 0.0455, which is significant at 0.05.
Examples
| Observed | χ² (df) | p-value |
|---|---|---|
| Coin 60, 40 | 4.0000 (1) | 0.0455 |
| Die 8,9,12,11,6,14 | 4.2000 (5) | 0.5210 |
| Die 30,10,10,10,10,20 | 23.3333 (5) | 0.0003 |
| Mendel 9:3:3:1 | 0.4700 (3) | 0.9254 |
| 2×2: 20,30/30,20 | 4.0000 (1) | 0.0455 |
| 2×3: 10,20,30/20,20,20 | 5.3333 (2) | 0.0695 |
Enter your observed counts and click Calculate χ².
Summary
This chi-square calculator computes the χ² statistic and its associated p-value from your observed and expected frequency counts. It supports both goodness-of-fit tests (one row of categories) and contingency-table independence tests (multiple rows and columns). Click Calculate to update the results and see a clear interpretation of statistical significance.
How it works
- Choose between Goodness-of-Fit or Independence (contingency table) mode.
- Enter the number of categories or table dimensions.
- Fill in your observed counts (and expected counts for goodness-of-fit).
- The calculator computes χ² = Σ (O − E)² / E across all cells.
- Degrees of freedom are calculated automatically from your table size.
- The p-value is derived from the chi-square cumulative distribution function.
Use cases
- Test whether a die is fair by comparing rolled outcomes to expected uniform distribution.
- Analyze survey responses to check if preferences differ by demographic group.
- Validate genetics experiments against expected Mendelian ratios.
- Check whether website conversion rates are independent of traffic source.
- Assess whether observed frequency data fits a theoretical distribution.
- Quality-control checks on manufacturing defect rates across production lines.