A novel, simple, and universal all-optical NAND gate using single-mode Fabry-Perot laser diode (SMFP-LD) is demonstrated. The basic operating principle of the proposed NAND gate is the modulation of the dominant lasing mode of SMFP-LD by the injection of external beams. The dominant lasing mode gain is suppressed only when both input beams are high. As SMFP-LD is used to demonstrate the logic function, no additional beam is required as needed in the multimode Fabry-Perot laser diode (MMFP-LD) schemes. The operating principle is explained and the experimental results are presented at 10 Gb/s input data. The logic function is realized with a clear eye opening and an extinction ratio of 14.6 dB with a rising and falling time of 38.3 and 67.1 ps, respectively.