Hafnium carbides (Hf-C system), known as ultra-high temperature ceramics, have attracted growing attention because of their unique features. In this paper, we carry out researches on the stable crystal structures in the Hf-C system at high pressures, using a variable-composition ab initio evolutionary algorithm implemented in the USPEX code. In addition to the ambient-pressure structures HfC (Fm3m), there are two new compounds Hf3C2 and Hf6C5 and two high-pressure structures of HfC. When pressures are lower than 100 GPa, no new structures are found other than those at ambient pressure, and Hf3C2 and Hf6C5 become metastable at 20 GPa and 100 GPa, respectively. At 200 GPa, a new compound Hf2C is found, and the stable structure HfC has changed from Fm3m to C2/m. At 300 GPa, another new compound HfC2 is found. At 400 GPa, the stable structure of HfC has changed again to the space group Pnma. And at 500 GPa, the stable structures are Hf2C, HfC2 and HfC (Pnma), no new structures are found except those at 400 GPa. The composition-pressure phase diagram that shows the pressure range of stable structures in Hf-C system is simulated by calculation of their enthalpies. When the pressures are lower than 15.5 GPa and 37.7 GPa, Hf3C2 and Hf6C5 are stable, respectively, and their space groups are both of C2/m. And Hf2C and HfC2, with space group I4/m and Immm, respectively become stable structures when the pressure is higher than 102.5 GPa and 215.5 GPa, respectively. The phase-transition route of HfC is Fm3mC2/mPnma, and the two phase-transition pressures are 185.5 GPa and 322 GPa, respectively, which are different from the conclusion of Zhao. Then we will show and discuss the newly predicted high-pressure structures and their crystallographic data, such as volume, lattice constants and atom positions. The crystal structures of HfC are described in the literature. The structure of Hf2C contains 12 atoms in the conventional cell, and carbon atoms lie at the center of decahedron consisting of 8 hafnium atoms. In the structure of HfC2, carbon atoms form the quasi-graphite sheets and hafnium atoms lie betweent the two sheets. The dynamical and mechanical stabilities of the high-pressure structures have been verified by calculations of their phonon dispersion curves and elastic constants. And the bulk modulus and shear modulus of HfC2 are larger than those of the other three high-pressure structures. Finally we will study their electronic properties, band structures, density of states (DOS), electron localization functions (ELFs), and the Bader charge analyses of these structures are simulated based on the first-principle. The band structure and density of states show that these four high-pressure structures have weak metallic and strong Hf-C covalent bond. The Bader charge analysis further proves the strong Hf-C covalent bond and weak ionic bond. And ELF shows the existence of CC covalent bond. In summary, the HfC bond shows strong covalence, weak metallicity and ionicity, and the CC bond is covalent.