Ionic control of magnetic properties, dubbed magneto-ionics, has gained much attention in recent years due to the sizable effects that can be induced by electrically controlled ion motion. Here we assess the mechanism by which hydrogen affects magnetic anisotropy in representative ferromagnetic/nonmagnetic metal layers. We take Co/Pd film as a model system that is widely used in spintronics. First-principles calculations demonstrate that the magnetic moment can be switched by 90 • via hydrogen insertion at the Co/Pd interface. This control results from hydrogen-induced changes in magnetic anisotropy originating from modifications to the electronic structure. Accumulation of hydrogen at the Co/Pd interface affects the hybridization between neighboring Co and Pd layers, leading to a decrease of the perpendicular anisotropy component, and eventually changes the net magnetic anisotropy to in-plane. Hydrogen penetration into the interior Co layers has the opposite effect, promoting perpendicular magnetic anisotropy. These changes are governed by competing contributions of the d xy ; d x 2 +y 2 and the 3d z 2 ; 3d zy states, which are mainly responsible for the perpendicular and the in-plane magnetocrystalline anisotropy, respectively. By using this understanding, we predict that hydrogen accumulation at Fe/V interfacial layers causes the opposite spin reorientation effect, promoting perpendicular magnetic anisotropy.