AP® Biology skills

Chi-square test

Test whether counts you observed fit what you expected, step by step.

About this tool

Test whether observed counts fit what a hypothesis predicts. Work out the expected counts, the chi-square value and the degrees of freedom, find the critical value in the table, and decide about the null hypothesis.

The formula and the steps

χ² = Σ (o − e)² / e

  • o is each observed count; e is the count expected if the null hypothesis is true: the total number counted × the expected fraction for that category.
  • Degrees of freedom = number of categories − 1.
  • Compare χ² with the critical value for your degrees of freedom at p = 0.05 (the table on this page). If χ² is larger, reject the null hypothesis: a difference this large would happen by chance less than 5% of the time. If it is smaller, fail to reject the null: chance could explain the difference. Failing to reject is not proof that the null is true.
  • Use counts, never percentages, and every expected count should be at least 5 for the test to be reliable.
  • Expected counts and χ² count when within one unit of the last decimal place asked for, or within 1%. Degrees of freedom must be exact; the critical value must match the table (for df 3, 7.81 and 7.82 both count).

Notes for this topic: Chi-square test