In this study, the interaction of 5-fluorouracil (5FU) drug with adenine (A), guanine(G), cytosine(C), uracil (U), and thymine (T) nucleobases of DNA and RNA are surveyed at the xB97XD/LANL2DZ, M06-2X/ 6-31G (d, p), MPW1PWQ1/6-31G(d, p), PBEPBE/6-31(d, p) and xB97XD/6-31G(d, p) levels of density functional theory (DFT). The considered complexes of 5FU drug with nucleobases are optimized at the above level of theories. Max Force and RMS of optimization criteria are 0.00035 (Ha), and 0.0003 respectively. From optimized structures, the adsorption energy, thermodynamic parameters in gas and solvent media, quantum theory atom in molecule (QTAIM), electron localized function (ELF), and reduced density gradient (RDG) are calculated at xB97XD/LANL2DZ and M06-2X/6-31G (d, p) level of DFT theory. The QTAIM, ELF, and RDG results confirm that the nature of bonding between 5FU drug with A, C, G, U, and T nucleobases is electrostatic or hydrogen bond type. The adsorption and thermodynamic energy results demonstrate that the interaction of the 5FU drug with C and G nucleobases is stronger than other nucleobases. The results of this study can be suggested the mechanism of interaction of the 5FU drug with nucleobases of DNA and RNA.