This paper focuses on designing and simulating a 4×2 all-optical encoder utilizing the wave interference effect within photonic crystals. The proposed structure includes four optical waveguides as inputs and two as outputs, with a total area of 133.9µm2. The encoder demonstrates a response time of 0.44 ps, a contrast ratio of approximately 13.3 dB, and a data transfer rate of 2.3 Tbit/s. The results highlight the structure’s high flexibility, efficient resolution, and competitive response time compared to other designs in this category, demonstrating its practical applicability, particularly for signal division tasks. The finite-difference time-domain technique and the plane wave expansion method were employed to analyze the simulation outcomes and determine the optical bandgap range essential for the design.