The molecular geometries and the relative energies of the ten most stable tautomers of guanine (G1, G2, G3...etc.) and thioguanine (TG1, TG2, TG3...etc.) have been investigated at the HF/3-21G and HF/6-31G** levels in the gas phase and in solution. Electron-correlation contributions have been determined at the MP2/6-31G** level in the gas phase. The solvent effects have been investigated by self-consistent reaction field (SCRF) theory. The introduction of a dielectric medium has an effect on the relative stability order of guanine and thioguanine tautomers. The results are discussed in terms of known experimental results.