Statistics & graphs · SL/HL
Chi-squared test
Compare observed counts with expected counts.
Your values
Number formats & units
Use decimal dots in datasets. Single values also accept decimal commas and scientific notation such as 1.2e-3 or 1.2 × 10⁻³.
Calculated locally. No account or input upload.
Result & working
ExampleThe calculator is loading. The worked example is also shown below.
Download results
Excel and CSV files can be imported into Google Sheets.
More results
Show calculation steps
Interpretation & assumptions
Copy & export
Formula & example
The relationship
What the variables mean
| Symbol | Meaning |
|---|---|
| Observed frequency. | |
| Expected frequency under the null model. |
Worked example
- Test type
- Goodness of fit
- Observed values
- 315 108 101 32
- Expected values
- 312.75 104.25 104.25 34.75
χ² = 0.470024, p = 0.92543
Follow the example steps
- 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
- Observed total = 556; expected total = 556.
- χ² = 0.470024; df = 3
- Right-tail p ≈ 0.92543.
Common mistakes
Divide each squared deviation by its expected count.
Incorrect approach
O = 20, E = 10: (O − E)²/O = 5
Correct approach
(O − E)²/E = 10
More checks before you submit
- Frequencies must be counts, not percentages with an arbitrary total.
- Very small expected counts can make the usual chi-squared approximation unreliable.
Method notes
In the current Biology syllabus, chi-squared is used in contexts including species association and genetic ratios.