The invention relates to a preparation method and application of a formaldehyde fluorescent probe, and belongs to the technical field of analytical chemistry. The formaldehyde fluorescent probe is a ratio-type fluorescent probe with double emission bands. The excitation wavelength is 318 nm; and the fluorescence peak at 359nm decreases gradually with the increasing of the concentration of formaldehyde, and at the same time a new emission band is produced at 451 nm and the fluorescence peak gradually increases. The formaldehyde fluorescent probe can resist the interference of acetaldehyde, glyoxal, methylglyoxal, benzaldehyde, alanine, glycine, serine, arginine, cysteine, glutathione and glucose, has high detection accuracy, high sensitivity and strong anti-interference capability. In addition, the formaldehyde fluorescent probe of the invention can detect the formaldehyde in a biological sample (cell environment), realizes formaldehyde fluorescence imaging in living cell level, and has potential practical application value. The synthesis of the formaldehyde fluorescent probe only needs a one-step reaction, which is simple and high in yield.