New compounds consisting of aniline units linked by polyether bridges have been synthesized and their electrochemical polymerization was performed via constant potential electrolysis and cyclic voltammetry in an aqueous solution containing 3.0 moI L-1 H2SO4. Chemical polymerization was carried out using (NH4)(2)S2O8 as oxidizing agent. It was found that both methods gave the same polymer product without any cleavage of the polyether bridge between aniline rings. The polymers were characterized using the Fourier transform infrared spectroscopic technique and the thermal behavior of electrochemically prepared polymers was investigated using thermogravimetric analysis. Spectroelectrochemical properties of the films were investigated using the in situ UV-visible spectroscopic technique. (c) 2007 Society of Chemical Industry.