Sunset yellow (FCF), a commonly used food additive, can brighten foods, but the improper amount of addition can also cause various diseases. Herein, the fluorescence sensor CDs‐PTD for detecting FCF is synthesized by functionalizing carbon dots (CDs) with 3,4,9,10‐pertetracarboxylic dianhydride (PTD). The prepared CDs‐PTD shows excitation‐independent fluorescence behavior with maximum fluorescence emission at 553 nm under 490 nm excitation and high quantum yields (21.4%). With the presence of FCF, the fluorescence of the sensor is quenched due to fluorescence resonance energy transfer (FRET). The CDs‐PTD exhibits excellent selectivity and sensitivity toward FCF in the range of 0–180 × 10−6 m with a low detection limit of 106.8 × 10−9 m. In addition, the sensor is applied to the detection of FCF in beverage samples with recoveries ranging from 97% to 106%. And a portable CDs‐PTD/agarose gel reagent strip is prepared for the assessment of FCF content within 15 min. The CDs‐PTD can be an ideal sensor for detecting FCF in food, and provides a new idea for the detection of food additives.