The tautomerism of uracil, 5-fluorouracil, and thymine has been investigated in the gas phase and in solution. Electron correlation effects were included in ab initio computations at the MP2 level, and DFT calculations were performed using the B3LYP level. Full geometry optimizations were conducted at the HF/6-31G**, HF/6-31+G**, and B3LYP/6-31+G** levels. Single-point MP2/6-31+G** calculations were performed on the HF/6-31+G** optimized geometries. The influence of the solvent was examined from self-consistent reaction field calculations performed with epsilon =2.21 (1,4-dioxane) and epsilon =78.54 (water). The calculated relative free energies (DeltaG) indicate that substitution of uracil at the position group does not change the relative free energy order of the uracil tautomers in the gas phase and in 1,4-dioxane (except at the MP2 level) whereas this ordering changes in water. Attachment of a fluorine atom changes the relative free energy order of uracil tautomers in the gas phase and in solution.