In this paper, the concept of photonic crystals (PhCs) is fundamental to designing and simulating an all-optical logic gate device. We proposed an all-optical switch composed of two-dimensional (2D) photonic crystal waveguides with a central photonic crystal ring resonator (PCRR). The new all-optical NAND logic gate device comprises two linear waveguides coupled to each other through a single compact PCRR. The plane wave expansion (PWE) and finite-difference time-domain (FDTD) methods are applied to simulate the properties of the system. The structure is implemented on the operational wavelength of 1700 nm on an air wafer of only 12 μm × 12 μm. Indeed, the simulation results show that the proposed all-optical NAND gate is a strong candidate for ultrafast photonic integrated circuits (PICs) for applications in optical communications, being advantageous with high transmitting power, with simple design, and without the use of optical amplifiers and nonlinear materials.