The invention belongs to the technical field of fluorescent probes, and provides a fluorescent probe for quantitatively detecting riboflavin on the basis of a fluorescence resonance energy transfer ratio, and a preparation method and an application for the fluorescent probe. The preparation method comprises the following steps: with glucose as a carbon source, ethylenediamine as a nitrogen source,concentrated phosphoric acid as a phosphorus source and concentrated hydrochloric acid as a chlorine source, preparing nitrogen-phosphorus-chlorine co-doped carbon quantum dots (NPCl-CQDs) through anacid-base neutralization reaction exothermic carbonization method, dissolving NPCl-CQDs powder into ultrapure water, carrying out centrifuging to remove insoluble substances, carrying out filtering to remove impurities, and carrying out freeze-drying so as to obtain the fluorescent probe, namely NPCl-CQDs solid powder. The linear relationship between a riboflavin concentration and an NPCl-CQDs fluorescence intensity is determined by using a ratio fluorescence detection method. The content of riboflavin in an actual sample is detected through a standard recovery experiment, and a standard recovery rate is calculated. The method provided by the invention is simple and convenient to operate, low in background interference, high in sensitivity, free of expensive instruments and equipment, lowin detection cost, capable of rapidly, efficiently and quantitatively detecting the content of the riboflavin in an actual sample in a ratio and good in reproducibility.