The adsorption of hydrogen-bonded and stacked nucleobase pairs on the hexagonal boron nitride (h-BN) surface was studied by density functional theory and molecular dynamics methods. Eight types of nucleobase pairs (i.e., GG, AA, TT, CC, UU, AT, GC, and AU) were chosen as the adsorbates. The adsorption configurations, interaction energies, and electronic properties of the nucleobase pair on the h-BN surface were obtained and compared. The density of states analysis result shows that both the hydrogen-bonded and stacked nucleobase pairs were physisorbed on h-BN with minimal charge transfer. The hydrogen-bonded base pairs lying on the h-BN surface are significantly more stable than the stacked forms in both the gas and water phase. The molecular dynamics simulation result indicates that h-BN possessed high sensitivity for the nucleobases and the h-BN surface adsorption could revert the base pair interaction from stacking back to hydrogen bonding in aqueous environment. The h-BN surface could immobilize the nucleobases on its surface, which suggests the use of h-BN has good potential in DNA/RNA detection biosensors and self-assembly nanodevices.