The pseudogap is a partial gap in the electronic density of states that opens in the normal (non-superconducting) state of cuprate superconductors and whose origin is a long-standing puzzle. Its connection to the Mott insulator phase at low doping (hole concentration, p) remains ambiguous and its relation to the charge order that reconstructs the Fermi surface at intermediate doping is still unclear. Here we use measurements of the Hall coefficient in magnetic fields up to 88 tesla to show that Fermi-surface reconstruction by charge order in the cuprate YBa2Cu3Oy ends sharply at a critical doping p = 0.16 that is distinctly lower than the pseudogap critical point p∗ = 0.19 (ref. 11). This shows that the pseudogap and charge order are separate phenomena. We find that the change in carrier density n from n = 1 + p in the conventional metal at high doping (ref. 12) to n = p at low doping (ref. 13) starts at the pseudogap critical point. This shows that the pseudogap and the antiferromagnetic Mott insulator are linked.