A Bronsted acidic ionic liquid 1-ethylimidazolium trifluoroacetate (HEImTfa) was prepared with high yield and used as a novel electrolyte for electropolymerization of aniline. HEImTfa played an important role in increasing the electrochemical polymerization rate of aniline. Scanning electron microscopy results showed that polyaniline prepared in HEImTfa (PAN–HEImTfa) was composed of significantly regulated nano-structures, which was smooth and homogeneous with a perfect-adhesion to Pt matrix. The electrocatalytic activity of PAN–HEImTfa for oxidation of formic acid was quite high and stable.