Abstract In this paper, ultra-fast, compact and high contrast ratio all optical half subtractor based on photonic crystal designed and simulated. The proposed design will be constructed using both threshold switching and interference of beams mechanisms. The proposed structure is composed of six waveguides and a nonlinear ring resonator. The simulation results show that the contrast ratio for D and B ports were obtained about 18.80 and 15.05 dB, respectively. Also the maximum rise, fall and steady-state times and total footprint for suggested all optical half subtractor are 0.5, 0.25, 1.5 ps and 234 μm2, respectively.