Abstract Plane wave density functional theory codes generally assume periodicity in all three dimensions. This causes difficulties when studying charged systems, for instance energies per unit cell become infinite, and, even after being renormalised by the introduction of a uniform neutralising background, are very slow to converge with cell size. The periodicity introduces spurious electric fields which decay slowly with cell size and which also slow the convergence of other properties relating to the ground state charge density. This paper presents a simple self-consistent technique for producing rapid convergence of both energies and charge distribution in the particular geometry of 2D periodicity, as used for studying surfaces.