The determination of vitamin B6 (VB6) in food is of great significance due to its vital role in maintaining health and its necessity for ingestion through dietary sources. Therefore, based on ionic liquid-based yellow-emitting carbon dots (Y-CDs), a novel fluorescence-smartphone dual-mode method was first developed. The present method was applied to the detection of VB6 in milk. In the fluorescence method, the formation of complexes between VB6 and Y-CDs results in a significant decrease of the fluorescence intensity of Y-CDs. VB6 in milk samples was successfully determined according to this method, which exhibited a low detection limit (5 × 10