All the simulations were carried out with the GPAW code. The wave functions were presented on a real-space grid with 0.18 Å grid spacing unless otherwise specified. The PBE functional was used in all the calculations. The continuum solvent was modelled using the SCMVD dielectric continuum model with a van der Waals radius of 2.0 Å for gold to accurately reproduce the differential capacitance. Constant potential calculations, both in the standard Fermi level and the new constant inner potential modes, were carried out using a modified SJM implementation. All the employed structure models were periodic in the xy-directions and non-periodic in the z-direction. Dirichlet boundary conditions were applied to achieve ϕ = 0 at the z-boundary for the considered charge states as detailed in the Supplementary Information. These boundary conditions uniquely define a reference electrode within the simulation cell. To model an inner sphere reaction, oxygen adsorption on a Au(111) hollow site was considered. The pure and oxygen-covered gold surfaces were modelled using a seven layer thick 1 × 1 surface cell with a 10 × 10 × 1 k-point sampling.