Using binary phase shift keying is one of the popular methods used for designing optical logic gates. In this paper, we used optical waveguides with different lengths for designing an all-optical XOR gate. The proposed structure works based on constructive and destructive interference of optical beams. The time delay of the proposed structure is 0.5 ps.