For the anodic H2O2 generation, it has been shown that the electrolyte composition can steer the reaction pathway toward increased H2O2 generation. Previous efforts made on composition optimization found that the impact of the molar fraction of carbonate species varies for different anodes, and therefore, controversies remain concerning the reaction pathways as well as the species involved in H2O2 formation. Considering that water oxidation results in the liberation of protons within the anode microenvironment, the corresponding acidification would cause an equilibrium shift between carbonate species, which in turn may modulate the reaction pathway. We determined the changes in the fraction of carbonate species in the vicinity of an anode by performing local pH measurements using a Au nanoelectrode positioned in close proximity to an operating anode by shear-force scanning electrochemical microscopy (SECM). It could be confirmed that the main anionic species at the interface is HCO3 -, at potentials where H2O2 is preferentially formed, regardless of the pH value in the bulk. The simultaneous use of a Au-Pt double barrel microelectrode in generator-collector SECM measurements demonstrates that the local HCO3 - concentration is collectively determined by the oxidation current, buffer capacity, and bulk pH of the electrolyte.