The effect of polyacrylamide on corrosion behavior of N80 steel in the HPAM/H2S/CO2 environment was studied by using weight‐loss and electrochemical tests to simulate the environment of production wells in polymer flooding. The morphology and composition of corrosion scales were studied by scanning electron microscopy, energy dispersive X‐ray spectrometer, and X‐ray photoelectron spectroscopy. The results show that as the polyacrylamide concentration increases, the uniform corrosion rate of N80 steel decreases gradually. The safe service life of N80 steel grows along with the increase of the concentration of polyacrylamide. The corrosion scales of N80 steel in the HPAM/H2S/CO2 environment is split into two layers, an inner layer of O‐rich composed of FeCO3 and an outer layer of S‐rich consisting of FeS. Polyacrylamide adsorbs on the surface of N80 steel to form a protective network, which blocks contact between the metal and the solution and then inhibits the anodic dissolution of the metal. Moreover, the growth of polyacrylamide concentration increases the pH value of the solution and promotes the ionization of H2S, HS−, and H2CO3 in the solution.