The invention discloses an all-optical diode, and relates to the technology of all-optical asymmetric transmission. The all-optical diode comprises a photonic crystal flat plate and a plane grating, the photonic crystal flat plate and the plane grating are arranged in parallel, the photonic crystal flat plate comprises an energy band structure with double Dirac cones, the double Dirac cones are intersected at a Dirac point, the Dirac point is located at a center of a Brillouin zone of the photonic crystal flat plate, the equivalent refractive index of the photonic crystal flat plate is zero ata frequency of the Dirac point, the frequency of an optical signal emitted to the all-optical diode is the frequency of the Dirac point, the thickness of the plane grating is arranged to enable the light intensity of a zero-order diffracted light to be zero when the optical signal is vertically emitted at one side of the plane grating, the transmissivity approaches zero when the optical signal isvertically emitted from one side of the plane grating, and the transmissivity approaches 1 when the optical signal is vertically emitted from one side of the photonic crystal flat plate. The all-optical diode is advantageous in that the structure is simple, the forward and reverse transmission contrasts are high, the forward transmissivity is high, the requirement of a strong field is avoided, and the integration is easy.