High pressure is an effective method to cause structural and electronic variations, further inducing novel high-pressure structures with excellent physical and chemical properties. Herein, we investigate the structural phase transition of hafnium dihydrogen (HfH2) in the pressure range of 0-500 GPa through the first-principles calculations and CALYPSO crystal structure prediction. The high-pressure phase transition sequence of HfH2 is I4/mmm →Cmma →P-3m1 and the two phase transition pressure points are 220.21 and 359.18 GPa, respectively. A newly trigonal P-3m1 structure with 10-fold coordination firstly appears as an energy superior structure under high pressure. These three structures are all metallic with the internal ionic bonding of Hf and H atoms. Moreover, the superconducting transition temperature (T
c) values of Cmma at 300 GPa and P-3m1 at 500 GPa are 3.439 K and 19.737 K, respectively. Interestingly, the superconducting transition temperature of the P-3m1 structure presents an upward trend as the pressure climbs, which can be attributed to the increment of electron-phonon coupling eventuated by the enhanced Hf-d electronic density of states at Fermi level under high pressure.