Hydrogenation and hydrodeoxygenation are significant and distinct approaches for the conversion of biomass and biomass-derived oxygenated chemicals into high value-added chemicals and fuels. However, it remains a great challenge to synthesize catalysts that simultaneously possess excellent hydrogenation and hydrodeoxygenation performance. Herein, we report a catalyst made of isolated single-atom Ru supported on mesoporous graphitic carbon nitride (Ru 1 /mpg-C 3 N 4 ), fabricated by a wet impregnation method. The as-prepared Ru 1 /mpg-C 3 N 4 catalyst shows excellent hydrogenation and hydrodeoxygenation performance. First-principles calculations reveal that the Ru atom is mobilized, and the active site is induced by adsorption of the reactants. A systematic reaction mechanism is proposed, suggesting that vanillyl alcohol is the deoxygenation prohibited product, while 2-methoxy-p-cresol is the deoxygenation allowed product. Thus, the excellent selectivity for the hydrogenation or hydrodeoxygenation of vanillin at different temperatures results from switching between the two types of products. © 2018 American Chemical Society.