Chemicals and poisons in the body interfere with the cell cycle and inhibit the growth of cancer cells. In this way, the function of chemicals in the body is controlled by taking anti-cancer drugs. Due to the degradability and compatibility of carbon nanotubes and boron nitride with the environment, they can act as suitable drug carriers for the transfer of anticancer drugs and deliver the drugs to the target cells. In the current work, the encapsulation of Formestane (FMS) anticancer drug into the carbon (CNT) and boron nitride (BNNT) (8,8) nanotubes was investigated for the first time using the density functional theory: B3LYP/3-21G* and the natural bond orbital analysis in the gas phase. Using natural bond orbital analysis, the charge transfer between FMS drug and CNT and BNNT nanotubes (8,8)/ FMS (BNNT/FMS) complexes were explored. Based on the results obtained from the calculation of encapsulation energy, it was found that the adsorption process was favorable. The interaction effects of FMS drug and CNT and BNNT (8,8) nanotubes on the natural bond orbital charge, the chemical shift parameters, and electronic properties were also evaluated. This study revealed that CNT and BNNT (8,8) nanotubes can be a suitable carrier for FMS drug delivery. The ultraviolet-visible spectra of the FMS drug, the CNT and BNNT (8,8), and the BNNT/FMS complexes were computed using time-dependent density functional theory (DFT: B3LYP) calculations.