Stable and adherent polymer films of polyaniline and of poly(2-anisidine) were grown on 304-stainless steel by cyclic voltammetry in tetrabutylammonium perchlorate/acetonitrile solution containing perchloric acid. Conducting poly(aniline-co-2-anisidine) was also formed on 304-stainless steel in same condition, but the film was unstable and peeled off after 3 h when it is immersed in aggressive solution. The structure and properties of these polymer films were characterized by FTIR and UV-vis spectroscopy and by electrochemical methods. The anti-corrosion behavior of polyaniline, poly(2-anisidine), and poly(aniline-co-2-anisidine) coated electrodes were investigated in 0.5 M hydrochloric acid solutions by potentiodynamic polarization technique, open circuit potential-time curves and electrochemical impedance spectroscopy. Poly(2-anisidine) film shows protection against corrosion 304-stainless steel in 0.5 M HCl by passivating steel substrate in similar manner as has been observed for polyaniline. But anti-corrosion behavior was slightly poorer than that of polyaniline. © 2005 Elsevier B.V. All rights reserved.