Imidazole, 1-methylimidazole, 2-methylimidazole, 4-methylimidazole, and benzimidazole were subjected to electrochemical and chemical oxidation. Chemical oxidation yields oligomers with higher molecular weight (DP > 12) than anodic oxidation (DP > 6) as detected by laser desorption mass spectrometry (LDMS). The oligomers have a relatively simple structure in which imidazole moieties are linked by N-N bonds. 1-Methylimidazole does not polymerize, and benzimidazole seems to react through the benzene carbon atoms as well as through the nitrogen atoms. Solubility of these products varies with the substituent group on the imidazole ring. We propose a variation of Diaz's mechanism of pyrrole polymerization that we base on cyclic voltammetry, spectral analysis, pH effects, laser desorption mass spectrometry, and computer calculations. The mechanism involves stepwise removal of an electron from the N-3 atom to produce a radical cation that then couples. LDMS data suggest that chemical polymerization occurs by rapid dimerization of imidazole followed by slower polymerization of the dimers. LDMS of electrochemical polymerization products suggests that polymerization occurs by addition of one imidazole unit at a time. None of these products exhibits electrical conductivity.