Statistics & graphs · SL/HL
Chi-Squared Test Calculator
Choose a goodness-of-fit list or a 2×2 observed table.
Your values
Start with the example or enter your own values. Use a dot for decimals and e for scientific notation.
Calculated locally. No account or input upload.
Result & working
ExampleThe calculator is loading. The worked example is also shown below.
Step-by-step working
The formula
χ² = Σ(O−E)²/E
goodness of fit: df = categories − 1
2×2 association: expected = row total × column total / grand total; df = 1
| Symbol | Meaning |
|---|---|
| O | Observed frequency. |
| E | Expected frequency under the null model. |
When to use this calculator
In the current Biology syllabus, chi-squared is used in contexts including species association and genetic ratios.
Worked example
The page opens with these example values. The result below is pre-generated for reference.
- Category 1: (O−E)²/E = (315−312.75)²/312.75 = 0.01618705
- Category 2: (O−E)²/E = (108−104.25)²/104.25 = 0.1348921
- Category 3: (O−E)²/E = (101−104.25)²/104.25 = 0.1013189
- Category 4: (O−E)²/E = (32−34.75)²/34.75 = 0.2176259
- χ² = 0.470024; df = 3
- Right-tail p ≈ 0.92543.
χ² = 0.470024, p = 0.92543
Common mistakes
- Frequencies must be counts, not percentages with an arbitrary total.
- Very small expected counts can make the usual chi-squared approximation unreliable.