New coccine is one of the most used red colorants in foods. Due to its cytotoxicity, quantitative determination is very necessary. Herein, the ratiometric fluorescent and UV absorption dual-mode nanosensor, derived from fangchinoline and o-phenylenediamine, was successfully prepared by hydrothermal way. The prepared carbon dots with three colors were purified with dialysis, thin layer chromatography and chromatographic column. Highly green fluorescence of Fan,N-CDs was quenched by new coccine with inner filter effect. The dependence of the ratiometric fluorescent response on new coccine concentrations was found linear over the range of 0–12.5 μM and 20–55 μM with LOD of 30.12 nM and 54.85 nm, respectively. The linearity of UV absorption ranged from 0 to 45 μM with of LOD 1.98 nM. In addition, the nanosensor was used to determine new coccine in energy drinks, carbonated beverage, gum and ketchup. It provides a new insight on the detection of new coccine by the dual-mode nanosensor. Schematic of the synthetic and purification route for fluorescent Fan,N-CDs and the applications as dual-mode for detection of New Coccine. [Display omitted] • The multicolor photoluminescent carbon dots were prepared via hydrothermal method. • The green ratiometric fluorescent Fan,N-CDs were purified by dialysis, thin layer chromatography and chromatographic column. • As a good candidate to detect new coccine, the green ratiometric fluorescent Fan,N-CDs show high selectivity. [ABSTRACT FROM AUTHOR]