Hybrid organic–inorganic perovskite materials provide noteworthy compact systems that could offer ground-breaking architectures for dynamic operations and advanced engineering in high-performance energy-harvesting optoelectronic devices. Here, we demonstrate a highly effective self-powered perovskite-based photodiode with an electron-blocking hole-transport layer (NiOx). A high value of responsivity (R = 360 mA W−1) with good detectivity (D = 2.1 × 1011 Jones) and external quantum efficiency (EQE = 76.5%) is achieved due to the excellent interface quality and suppression of the dark current at zero bias voltage owing to the NiOx layer, providing outcomes one order of magnitude higher than values currently in the literature. Meanwhile, the value of R is progressively increased to 428 mA W−1 with D = 3.6 × 1011 Jones and EQE = 77% at a bias voltage of − 1.0 V. With a diode model, we also attained a high value of the built-in potential with the NiOx layer, which is a direct signature of the improvement of the charge-selecting characteristics of the NiOx layer. We also observed fast rise and decay times of approximately 0.9 and 1.8 ms, respectively, at zero bias voltage. Hence, these astonishing results based on the perovskite active layer together with the charge-selective NiOx layer provide a platform on which to realise high-performance self-powered photodiode as well as energy-harvesting devices in the field of optoelectronics.