In situ scanning tunneling microscopy (STM) was used to study the adsorption and polymerization of aniline on Au(111) single-crystal electrode in 0.1 M perchloric acid and 0.1 M benzenesulfonic acids (BSA) containing 30 mM aniline, respectively. At the onset potential of aniline's oxidation. similar to 0.8 V [vs reversible hydrogen electrode], aniline molecules were adsorbed in highly ordered arrays, designated as (3 x 2 root 3) and (4 x 2 root 3) in perchloric acid and BSA, respectively. These structures consisted of intermingled aniline molecules and perchlorate or BSA(-) anions zigzagging in the < 110 > directions in HClO(4) and in the < 121 > directions in BSA. The coverage of aniline admolecule on Au(111) was lower in BSA than in HClO(4). Raising the potential to 0.9 V or more positive values triggered the oxidation and polymerization of aniline. With aniline molecules;arranging in a way similar to the backbone of PAN in HClO(4), they readily coupled with each other to produce linear polymeric chains aligned predominantly in the < 110 > directions of the Au(111). Compared with the results observed in H(2)SO(4) (Lee et al. et al. J. Am. Chem. Soc. 2009, 131, 6468), the rate of polymerization was slower in HClO(4) and the produced PAN molecules tended to aggregate on the Au(111) electrode. PAN molecules generated in HClO(4) were anomalously shorter than those formed in H(2)SO(4). In 0.1 M BSA, PAN molecules produced by small overpotential (eta < 100 mV) could assume linear chains or 3D aggregates, depending on [aniline]. These results revealed molecular level details in electropolymerization of aniline, highlighting the important role of anion in controlling the conformation of PAN molecules and the texture of PAN film.