Factors influencing the reaction of chemical polymerization during aniline doping with hydrochloric acid (HCl) have been studied in this work. The optimal parameters for the preparation of polyaniline were determined as follows: aniline concentration - 4 mass %, molar ratios of oxidant (NH4)2S2O8:aniline - 1.2:1 and 1.3:1, the concentration of dopant - 1 mol/L. Fourier transform infrared spectroscopy (FT-IR) was applied to characterize the structure of polyaniline.