Nitrogen-doped graphdiyne quantum dots (NGDYQDs) have been synthesized hydrothermally from sphybridized N-doped graphdiyne and employed to fabricate an electrochemical sensor for the quantification of chloramphenicol (CAP), a typical nitro group-containing antibiotic, in water. The principle of this quantification is based on the high electrocatalytic activity of NGDYQDs to the reduction of −NO 2 groups in CAP to hydroxylamine groups. The effects of the electronic structure and size of the quantum dots on electrocatalytic activity were studied experimentally and theoretically. To prepare a sensor for CAP quantification, a suspension of NGDYQDs was prepared, and the NGDYQDs were deposited on a glassy carbon (GC) electrode. The prepared sensor showed a linear response to CAP from 0.1 to 114.5 μM with a limit of detection of approximately 5 nM (at a signal-to-noise ratio of 3) and a sensitivity of approximately 8.79 μA −1 μM −1 cm −2 , as well as high repeatability, reproducibility, and stability. Moreover, the sensor has high selectivity and resistance to interference in the presence of other antibiotics (five randomly selected antibiotics: furazolidone, 2-nitroimidazole, amoxicillin, ciprofloxacin, and erythromycin), common biological compounds (glucose, ascorbic acid, and uric acid), common aqueous ions