Let W be a 2-dimensional right-angled Coxeter group. We characterise such W with linear and quadratic divergence, and construct right-angled Coxeter groups with divergence polynomial of arbitrary degree. Our proofs use the structure of walls in the Davis complex.