In this work, a polyaniline film was synthesized on the surface of ITO (indium tin oxide)–PET (polyethylene terephtalate) plastic substrate by cyclic voltammetry electrochemical method to prepare a transparent flexible counter electrode. Then, the surface growth mechanism of polyaniline film was analyzed, and the AC impedance and cyclic voltammetry curves were tested. The dye‐sensitized solar cell (DSSC) device was assembled for photocurrent density‐voltage curves (J‐V) test, and the photoelectric performance of the flexible polyaniline counter electrode was further discussed. All of the above tests were compared to electrochemically deposited Pt electrodes. The results show that the polyaniline has a larger specific surface area for the electrode, which is more conductive to the catalytic reduction of the iodide on the electrode. Moreover, its porous structure is more conductive to the diffusion and reaction of
redox couples. Under the influence of dense layer and porous structure of polyaniline film, the cell performance of 25‐sweep‐segment polyaniline counter electrode is the best. Comparing with the conventional Pt electrode, the flexible counter electrode prepared by electrochemical synthesis not only has the same performance, but also reduces the cost by about 40 %, which is of great significance for promoting the application of DSSC.