This study presents the design and optimization of multi-functional all-optical NOT and XOR logic gates based on interference effects within two-dimensional photonic crystal structures. Our approach aims to address the growing demand for high-performance components in next-generation photonic integrated circuits (PICs). We enhanced the structure’s applicability and performance by carefully optimizing the output waveguide configuration. Our design achieved impressive performance metrics, including a response time of approximately 0.15 ps, a contrast ratio of 32.88 dB, and a bit rate of roughly 6.67 Tbit/s. Notably, the compact size of 83.55 μm² makes our design particularly suitable for PICs. To demonstrate the versatility of our approach, we developed an optimized 4 × 2 encoder based on the same design principles. This more complex structure with a compact size of 133.67 μm² exhibited a contrast ratio of approximately 26.54 dB, further validating the flexibility and practicality of our designs for integration into optical circuits. Our methodology employed the plane wave expansion method for determining and analyzing the photonic bandgap range. In contrast, the finite-difference time-domain method was utilized to simulate and evaluate the proposed structures’ performance. These results collectively demonstrate the significant potential of our designs for future PIC applications, offering a promising pathway toward high-performance, integrated optical computing systems.