Polyaniline (PANi), poly(2-iodoaniline) (PIANi), and poly(aniline-co-2-iodoaniline) (co-PIANi) were synthesized using cyclic voltammetry in acetonitrile solution containing tetrabuthylammonium perchlorate (TBAP) and perchloric acid (HClO4) on 304-stainless steel electrodes. Adherent and black polymer films were obtained on the electrodes. The structure and properties of these polymer films were characterized by FTIR and UV-vis spectroscopy and electrochemical method. The corrosion performance of PANi, PIANi, and co-PIANi coated electrodes were investigated in 0.5 M hydrochloric acid (HCl) solutions by potentiodynamic polarization technique, open circuit potential-time curves and electrochemical impedance spectroscopy, EIS. It was found that the PANi film could provide much better protection than PIANi, and co-PLANi and PANi films have barrier property as well as acting as passivator. On the other hand PIANi and co-PIANi films are acting as barrier coatings which were related with the prevention of cathodic reaction taking place at metal\electrolyte interface. EIS measurement shows that every coating gives protection efficiency of greater than 75% after 48 h of immersion time in corrosive test solution. (c) 2005 Elsevier B.V. All rights reserved.