Two-dimensional (2D) materials provide a new strategy for developing photodetectors at the nanoscale. The electronic and optical properties of black phosphorus (BP), indium selenide (InSe) monolayer and BP/InSe heterojunction were investigated via first-principles calculations. The geometric characteristic shows that the BP, InSe monolayer and BP/InSe heterojunction have high structural symmetry, and the band gap values are 1.592, 2.139, and 1.136 eV, respectively. The results of band offset, band decomposed charge and electrostatic potential imply that the heterojunction structure can effectively inhibit the recombination of electron–-hole pairs, which is beneficial for carrier mobility of photoelectric devices. Moreover, the optical properties, including refractive index, reflectivity, electron energy loss, extinction coefficient, absorption coefficient and photon optical conductivity, show excellent performance. These findings reveal the optimistic application potential for future photoelectric devices. The results of the present study provide new insight into challenges related to the peculiar behavior of the aforementioned materials with applications.