The electronic and photocatalytic properties of a type-II ZnS/HfS2 heterojunction are comprehensively analyzed through first-principles calculations in this paper. By calculating the binding energy and phonon spectrum of five potential stacking patterns, the stable structure of the ZnS/HfS2 heterojunction is determined. The electronic structure calculations indicate that the heterojunction has a type-II alignment with a 1.26 eV band gap. The heterojunction exhibits high carrier mobilities (4387.36 and 9561.39 cm2V–1S−1 for X and Y directions). The photocatalytic water splitting process of the heterojunction can be explained by the direct Z-scheme mechanism. The built-in electric field enables rapid recombination of electron-hole pairs at CBM and VBM, while the hydrogen evolution reaction and oxygen evolution reaction can separately be achieved at the ZnS layer and HfS2 layer to complete the overall water splitting. The free energy analysis indicates that the ZnS/HfS2 heterojunction has high activity for overall water splitting under illumination. Moreover, the calculated solar-to-hydrogen efficiency of the heterojunction reaches 30%, ensuring its photocatalytic performance. Remarkably, the type-II alignment is maintained and the catalytic performance can be further improved under biaxial strain because of the enhanced optical absorption in visible light and the reduced band gap. This work reveals that ZnS/HfS2 heterojunction is a potentially novel photocatalytic material for efficient overall water splitting.