A pH simulator consisting of an efficient numerical solver of a system of nine nonlinear equations was constructed and implemented in the modeling software MATLAB. The pH simulator was integrated in a granular biofilm model and used to simulate the pH profiles within granules performing the nitritation–anammox process for a range of operating points. The simulation results showed that pH profiles were consistently increasing with increasing depth into the granule, since the proton-producing aerobic ammonium-oxidizing bacteria (AOB) were located close to the granule surface. Despite this pH profile, more NH3 was available for AOB than for anaerobic ammonium oxidizers, located in the center of the granules. However, operating at a higher oxygen loading resulted in steeper changes in pH over the depth of the granule and caused the NH3 concentration profile to increase from the granule surface towards the center. The initial value of the background charge and influent bicarbonate concentration were found to greatly influence the simulation result and should be accurately measured. Since the change in pH over the depth of the biofilm was relatively small, the activity potential of the microbial groups affected by the pH did not change more than 5% over the depth of the granules.