In the presented structure, the performance of the all-optical XOR logic gate (AO-XOR-LG) is investigated. The XOR-LG is designed and simulated using a photonic crystal semiconductor optical amplifier (PC-SOA) based on Mach–Zehnder interferometer (MZI) and cross-phase modulation (XPM) nonlinear mechanism. The input optical pulse train used in this simulation is the type of RZ (Return-to-Zero). The finite difference method (FDM) has been used to solve the rate and propagation equations. The effect of input signal energy, bias current, and group refractive index on the output signal and gain of the XOR-LG is studied. The optimal mode is obtained for the XOR-LG with a bit rate of 80 Gbps. Furthermore, for the first time, the effects of quality factor (QF), conversion efficiency (CE), extinction ratio (ER), pattern effect (PE), and gain recovery are simultaneously analyzed in the simulation to increase PC-SOA performance. According to the results, PC-SOA has a more reasonable logic performance than conventional SOA, and due to its much shorter length than SOA, it can be a much better choice for integrated optical circuits.