The explosive demand for a wide range of data processing has sparked interest towards a new logic gate platform as the existing electronic logic gates face limitations in accurate and fast computing. Accordingly, optoelectronic logic gates (OELGs) using photodiodes are of significant interest due to their broad bandwidth and fast data transmission, but complex configuration, power consumption, and low reliability issues are still inherent in these systems. Herein, we present a novel all-in-one OELG based on the bipolar spectral photoresponse characteristics of a self-powered perovskite photodetector (SPPD) having a back-to-back p+-i-n-p-p+ diode structure. Five representative logic gates (“AND”, “OR”, “NAND”, “NOR”, and “NOT”) are demonstrated with only a single SPPD via the photocurrent polarity control. For practical applications, we propose a universal OELG platform of integrated 8 × 8 SPPD pixels, demonstrating the 100% accuracy in five logic gate operations irrelevant to current variation between pixels.