The structural and electronic properties of poly(3,4-phenylenedioxythiophene) and poly(3,4-ethylenedioxythiophene) have been studied using quantum mechanical methods. Calculations have been performed considering a series of oligomers up to 12 repeating units in the neutral and cation states, results being used to extrapolate the properties of the two polymers in the undoped and doped states. Moreover, the electronic properties were estimated in the gas phase and acetonitrile solution, the latter solvent being used in the electrogeneration of the two conducting polymers. A detailed analysis of the results indicates that, although the pi-pi* transition energy of poly(3,4-ethylenedioxythiophene) is lower than that of poly(3,4-phenylenedioxythiophene) in the neutral state, the latter behaves as excellent electronic conductor upon p-doping. Accordingly, the oxidized poly(3,4-phenylenedioxythiophene) shows the lowest pi-pi* electron transition energy.