In situ scanning tunneling microscopy (STM) is used to study the morphology and molecular structure of polyaniline (PAN) produced electrochemically on Au(1 1 1) electrode in 0.5 M nitric acid containing 30 mM aniline. Aniline molecules are coadsorbed with nitrate anions in zigzagged chains running parallel to the 〉1 1 0〈directions of the Au(1 1 1) electrode. A highly ordered (3 × 2√3)rect adlattice is observed between 0.5 and 0.8 V (vs. reversible hydrogen electrode), which restructures into a (3 × 2√21) phase at E > 0.85 V. Guided by the ordered aniline adlayer, the second aniline adlayer is oxidized and polymerizes at 0.92 V, yielding one-dimensional PAN stripes aligned along the 〉1 1 0〈directions of the Au(1 1 1) substrate. Molecular-resolution STM imaging discerns benzoidal and quinoidal rings in the backbone of PAN. The first two PAN layers grow as a smooth film, but the subsequent layers are deposited in 3D to give a rough morphology. Switching the potential from 0.8 to 0.6 V reconfigures PAN molecules from linear to winding form.