A methodology has been developed for predicting localized corrosion of corrosion-resistant alloys in environments that contain chlorides and H2S at conditions that are relevant to oil and gas production. The key element of this methodology is the computation of the repassivation potential using a mechanistic model that incorporates the effects of temperature and aggressive and inhibitive species. The repassivation potential is a measure of the tendency of an alloy to undergo localized corrosion in a given environment because it defines the threshold condition for the existence of stable pits or crevice corrosion. The predicted repassivation potential is then compared to the corrosion potential in the same environment to determine the alloy’s susceptibility to localized corrosion. Furthermore recent research indicates that the repassivation potential also provides a threshold condition for stress corrosion cracking. The fundamentals of the repassivation potential model were developed previously (Anderko et al. Corrosion Sci. 2004 46 1583 ibid. 2008 50 3629) by considering competitive dissolution adsorption and oxide film formation processes at the interface between the metal and the occluded site solution. In this study the model has been extended by introducing the effect of H2S which undergoes adsorption at the alloy/solution interface. The presence of H2S may give rise to a strong enhancement of anodic dissolution in the occluded environment and/or the formation of solid metal sulfide phases which compete with the formation of the oxide in the process of repassivation. The model elucidates the conditions at which H2S increases the propensity for localized corrosion and those at which it does not. The model has been calibrated and verified using extensive repassivation potential data for S13Cr and more limited data for alloy 2507 and other alloys. The main advantage of the model is its capability of predicting the repassivation potential over wide ranges of experimental conditions using parameters that are generated from a limited number of experimental data.