In this paper, the structure and electronic properties of InP/PtS2 heterojunction as well as the photocatalytic and solar hydrogen production efficiency are studied by first principles. Studies have shown that InP/PtS2 heterojunction is type II band alignment, typical Z heterostructure, has strong light absorption coefficient in the absorption spectrumand, InP/PtS2 heterojunction with an indirect bandgap of 1.97 eV,the band edge positions that meet the energy band prerequisites for water splitting across different pH levels,The band edge positions and light absorption capabilities have been modified through biaxial strain, with tensile strain enhancing the absorption capacity within the visible light spectrum ranging from 450 to 800 nm(nm). The InP/PtS2 heterojunction achieves a solar-to-hydrogen conversion efficiency (ηSTH) of 32.5%, which is higher than that of most heterojunctions. The InP/PtS2 heterojunction is anticipated to emerge as a promising contender for the next generation of photocatalysts.