Background6-mercaptopurine (6-MP) is an anticancer drug used in the treatment of a variety of cancers. Regarding its wide application, rapid and accurate detection of 6-MP is of great interest. Conventional techniques have significant drawbacks such as complex sample preparation, time-consuming analysis, and being expensive. On the other hand, fluorometric sensors have been used vastly to detect various chemical and biological analytes. MethodsHydrothermal technique synthesized carbon quantum dots (CQDs) using a facile and environmentally benign approach using sweet potato as the carbon source. It was observed that in the presence of the 6-MP drug, the fluorescence emission of CQDs was enhanced. At first, the effect of important parameters (pH, temperature, and the CQDs volume ratio) on the fluorescence emission intensity was studied. Then the fluorometric sensor was used to determine 6-MP in different concentration ranges and complex solutions. Significant findingsThe developed sensor showed promising results for the determination of 6-MP in the linear range of 0.4–5.4 mg L−1 and the detection limit of 0.01 mg L−1. The results were repeatable even in complex solutions in the presence of possible interfering species.