Sulfur dioxide (SO2) is a typical additive that serves as an antioxidant, preservative, and decolorizer in industrial production. Yet, excessive SO2 residues in the products pose a potential risk to human health. Although many fluorescent probes have been developed for the detection of SO2, effectively eliminating the interference from thiols on the selective recognition of SO2 remains a challenge. Herein, we developed a coumarin-derived ratiometric fluorescent probe 1 for quantitatively sensing the SO2 residues in actual samples. This probe can selectively recognize bisulfite (HSO3-) based on the different pKa values between HSO3- and thiols. The working mechanism of this probe was further rationalized by the combination of experiments and quantum chemical calculations. Probe 1 was successfully used for the quantitative detection of SO2 residues in medicine-food homology (MFH) samples with good sensitivity and accuracy. Furthermore, rapid visual and semi-quantitative detection of SO2 can also be realized through a disposable test tube.