Homogeneous and adherent polyaniline coatings were electrosynthesized on aluminum (Al) alloy 3004 (AA 3004) from an aqueous solution containing aniline and oxalic acid by using the galvanostatic polarization method. A higher applied current density in the polymerization stage proved to be the best condition to adopt for the synthesis of more compact and strongly adherent polyaniline coatings on Al. The corrosion performances of polyaniline coatings were investigated in 3.5% NaCl solution by the potentiodynamic polarization technique and electrochemical impedance spectroscopy (EIS). Potentiodynamic polarization and electrochemical impedance spectroscopy studies reveal that the polyaniline acts as a protective layer on Al against corrosion in 3.5% NaCl solution. The current corrosion decreases significantly from 6.55μAcm−2 for uncoated Al to 0.158μAcm−2 for polyaniline-coated Al. The corrosion rate of the polyaniline-coated Al is found to be 5.17×10−4 mmyear−1, which is ∼40 times lower than that observed for bare Al. The potential corrosion increases from −1.015V versus SCE for uncoated Al to ∼−0.9V versus SCE for polyaniline-coated Al electrodes. The positive shift of ∼0.11V in potential corrosion indicates the protection of the Al surface by the polyaniline coatings. The synthesized coatings were characterized by UV–visible absorption spectrometry, Fourier transform infrared spectroscopy (FTIR) and scanning electron microscopy (SEM). Optical absorption spectroscopy reveals the formation of the emeraldine form of polyaniline. The results of this study clearly ascertain that the polyaniline has outstanding potential to protect the AA 3004 alloy against corrosion in a chloride environment.