Abstract Results of a theoretical, comparative study of the electronic properties of trans-polyacetylene and polycarbonitrile are reported. Polyacetylene consists of zigzag chains of CH units, whereas polycarbonitrile has every second CH unit replaced by an N atom. Ground-state properties (structure, electronic bonds and bands, densities of states, momentum distributions, and reciprocal form factors) of the periodic, infinite, isolated chains are studied by means of first-principles, density-functional calculations. It is demonstrated how the presence of the (nitrogen) heteroatoms in the backbone of polycarbonitrile leads to a partial localization of the electrons. In order to investigate charged chains, model calculations are subsequently performed. These indicate solitons but not polarons to be stable. In total, the analysis demonstrates how the combination of information that can be obtained from various experiments provides a detailed description of the compounds.