By using the particle swarm optimization algorithm for crystal structure prediction, we reveal a newly orthorhombic Cmcm structure of HfB4, which is more energetically superior to the previously proposed YB4-, ReP4-, FeB4-, CrB4-, and MnB4-type structures in the considered pressure range. The phonon dispersion and elastic constants calculations confirm that the new phase is dynamically and mechanically stable. The calculated large shear modulus (240 GPa) and high hardness (45.7 GPa) imply that the predicted Cmcm-HfB4 is a potential superhard material. Meanwhile, the directional dependences of the Young's modulus, bulk modulus, and shear modulus for HfB4 are systematically investigated. Further analyses of the density of states and electronic localization function indicate that the strong B-B and B-Hf covalent bonds greatly contribute to its high hardness and stability.