A comprehensive model has been developed for the computation of corrosion rates of carbon steels in the presence of carbon dioxide, hydrogen sulfide and aqueous brines. The model combines a thermodynamic model that provides realistic speciation of aqueous systems with an electrochemical model for partial cathodic and anodic processes on the metal surface. The partial processes taken into account by the model include the oxidation of iron and reduction of hydrogen ions, water, carbonic acid and hydrogen sulfide. Also, the model includes the formation of iron carbonate and iron sulfide scales and their effect on the rate of general corrosion as a function of temperature and solution chemistry. The model has been verified by comparing calculated corrosion rates with laboratory data under conditions that mayor may not be conducive to the formation of protective scales. Good agreement between the calculated and experimental corrosion rates has been obtained. The model has been incorporated into a program that makes it possible to analyze the effects of various conditions such as temperature, pressure, solution composition or flow velocity on corrosion rates. KEY WORDS: CO2 corrosion, H2S corrosion, iron carbonate, iron sulfide, electrochemical model, thermodynamics