Malononitrile can be transformed into hypertoxic hydrogen cyanide which induces severely jeopardizes to human beings and environment. However, an effective detection technology for malononitrile was still lacking, which means that it is necessary to develop new sensitive analysis technology for malononitrile. Here in, a high sensitive fluorescent probe NQBS for detecting malononitrile was designed and synthesized from the derivative of natural product nopinone. NQBS could selectively recognize malononitrile from 26 kinds of competitive compounds in N, N-dimethylformamide (DMF) solution. The detection limit of NQBS for malononitrile was calculated to be 1.96 μM at the concentration range of 0–25 μM. In addition, the sensing mechanism of NQBS towards malononitrile was proved with high resolution mass spectrometer (HRMS), nuclear magnetic resonance hydrogen spectroscopy (1H NMR), and density functional theory (DFT) calculation analysis as Knoevenagel condensation process and intramolecular cyclization reaction. With the assistance of smartphone and color recognition software, NQBS was well applied in the on-site recognition of malononitrile in real time by analyzing the change trend of the red–greenblue (RGB) value of the NQBS solution.