The pH of wastewater in various stages of its purification depends mainly upon the equilibria of carbonic acid. Thus relations between pH and the concentrations of carbon dioxide, bicarbonate and carbonate can be formulated. Corrections for the non-ideal character of the sewage are necessary. With some restrictions the concept of alkalinity can be used for these pH relations. Several (bio)chemical and physical processes occurring in biological purification affect the concentrations of carbon dioxide and (bi)carbonate. Processes studied are carbon dioxide desorption, oxidation of organic matter and nitrification. Models are proposed for the calculation of the effluent pH and the values so obtained are compared with the available experimental results.