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.

Chi-Squared Test Calculator inputs

Calculated locally. No account or input upload.

Result & working

Example

The calculator is loading. The worked example is also shown below.

The formula

χ² = Σ(O−E)²/E

goodness of fit: df = categories − 1

2×2 association: expected = row total × column total / grand total; df = 1

What the variables mean
SymbolMeaning
OObserved frequency.
EExpected 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.

  1. Category 1: (O−E)²/E = (315−312.75)²/312.75 = 0.01618705
  2. Category 2: (O−E)²/E = (108−104.25)²/104.25 = 0.1348921
  3. Category 3: (O−E)²/E = (101−104.25)²/104.25 = 0.1013189
  4. Category 4: (O−E)²/E = (32−34.75)²/34.75 = 0.2176259
  5. χ² = 0.470024; df = 3
  6. 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.