By combining first-principles calculations and experiments, the effects of Hf doping on the stability and magnetic properties of the metastable SmCo 7 alloy were studied. It is found that the single TbCu 7 -type phase can be stabilized well by Hf doping when the Co-2e sites are occupied in the lattice structure. However, if Hf occupies the Co-3g sites, destabilization of the SmCo 7 phase may occur. Moreover, Hf doping changes the partial density of states of Sm atoms in the vicinity of Co-2e sites, which causes a decrease in the net magnetic moments and hence a decrease in the saturation magnetization. The experimental results confirmed the calculation results of the phase stability and magnetic performance of the Hf-doped SmCo 7 alloys.