Compressed ternary alloy superhydrides are currently considered to be the most promising competitors for high-temperature superconducting materials. Here, the stable stoichiometries in the Y–Hf–H ternary system under pressure are comprehensively explored in theory and four fresh phases are predicted: Pmna-YHfH6 and P4/mmm-YHfH7 at 200 GPa, P4/mmm-YHfH8 at 300 GPa and P-6m2-YHfH18 at 400 GPa. The four Y–Hf–H ternary phases are thermodynamically and dynamically stable at corresponding pressure. In addition, structural features, bonding characteristics, electronic properties, and superconductivity of the four ternary Y–Hf–H phases are systematically calculated and discussed. As the hydrogen content and the density of states of H atoms at the Fermi level increase, the superconducting transition temperatures (Tc) of Y–Hf–H system are significantly enhanced. The P-6m2-YHfH18 with high hydrogen content exhibits a high calculated Tc value of 130 K at 400 GPa.