Martensitic and duplex stainless steels have been used widely as well tubing material in oil and gas production because of their high strength resistance to corrosion and cracking especially in hydrogen sulfide (H2S) and high carbon dioxide (CO2) environment. This work is to study an effect of pH and H2S on the corrosion resistance of the martenisitc and duplex stainless steels. The materials used in this study are 13%Cr super 13%Cr and 2205 duplex stainless steels. The test solutions contain 500 ppm of NaCl with different pH saturated with 3.5% H2S in CO2. EIS is used to study the properties of the passive film and the potentiodynamic test is used to determine the corrosion resistance behavior of the specimens. It is found that pH values of the test solutions before and after saturated with 3.5% H2S change from 2 3 4 5 6 and 7 to 1.6 2.6 3.8 3.9 3.9 and 3.9 respectively. At pH 1.6 all of the specimens corrode significantly especially 13%Cr which its corrosion rate is 10.6 mmpy and the corrosion rate of super 13%Cr and 2205 are 5.4 and 4.6 mmpy respectively. At pH 2.6 2205 has high film resistance low corrosion rate of 0.0063 mmpy and the critical current of 0.0063 mA/cm2. On the other hand 13%Cr and super 13%Cr have low film resistance and corrosion rate of 0.66 and 0.35 mmpy. At pH higher than 3.8 corrosion resistance of all specimens increases significantly. Corrosion rate of 13%Cr is around 4 times of super 13%Cr and 6 times of 2205. The film resistance of 2205 remains un-change (110300 ohm.cm2) and is 2 times of the resistance at pH 2.6 (65650 ohm.cm2).