where ∆E is the energy difference between a system with a virtual proton and without. The subscript 0 on the brackets indicates that the sampling for calculating the average is performed using the unperturbed system, without the virtual proton. To obtain pH, however, one also needs the average concentration of free hydronium ions inside the cell. For intermediate and large pH, however, there might not be any free hydroniums present inside the simulation cell at all, preventing us from accurately calculating the pH of the system. To overcome this difficulty, in this paper we will introduce a new surface Widom insertion algorithm to easily and accurately calculate the pH of a canonical system undergoing protonation/deprotonation reactions. The paper is organized as follows: In section II we briefly review the canonical reactive MC algo-rithm , in section III we preset a new surface Widom insertion method and discuss the modification of the usual Ewald summation necessary to properly account for the electrostatics of an infinite charge nonneutral system. We will also compare the titration isotherms calculated using the canonical simulation algorithms with the ones obtained using rGCMCD method. Finally, the discussion and conclusions will be presented in the section IV.