Hypoxanthine (HX), xanthine (XA), and uric acid (UA) are important molecules in human beings. However, the physics underlying the interaction between these molecules and carbon nanomaterials is still unclear. In this study, we theoretically anlaysed the interaction of the graphene with HX, XA, and UA via the LDA, Perdew-Burke-Ernzerhof, and a second version of van der Waals (vdW)-DF2 exchange-correlation functionals of density functional theory. It was observed that these molecules could be adsorbed on the surface of the graphene steadily. The adsorption energies of these molecules on the graphene for the same site in vdW-DF2 functional show the following ordering: UA > XA > HX, the adsorption distances the following ordering: UA < XA < HX. The mechanism of this stable adsorption was revealed to be π -π and O-π interactions between these molecules and the graphene. Simulated scanning tunnelling microscopy (STM) images of HX, XA, and UA on the surface of the graphene layer as application, HX can be distinguished from XA and UA via the STM technique as a result of the interaction between the graphene and these molecules. The findings of this study provide a theoretical reference in the development and design of highly accurate biodevices and biosensors.