Carbon dots (CDs) derived from biological entities significantly play a major part in environmental and biomedical applications, comprising electrocatalytic oxidations, antibiotics detection, biosensing, and bioimaging. In the present work, facile green synthesis of blue-emitting CDs has been done using one-step hydrothermal treatment of pulp extract of Ziziphus mauritiana, acting as a natural source of carbon for optical determination of ciprofloxacin (CIP) antibiotics. The process is easy, safe for the environment, and doesn't require any specialized equipment or chemicals. The structural and optical characteristics of the synthesized CDs are done using XRD, FTIR, UV–visible spectroscopies, SEM-EDX, PL, and TEM. CDs were found to have a quasi-spherical shape with an average size of 2.54 nm. Nitrogen (1.2 wt.%), oxygen (41.8 wt.%), and carbon (40.7 wt.%) are the main component found in CDs, as observed by EDX. These CDs showed blue emission under UV light, excitation-dependent emission, and wide excitation-emission spectra. These prepared CDs were used to selectively detect CIP and exhibit a high quantum yield of 30% at the excitation wavelength of 340 nm. After the optimal parameters, the sensor gave the linear detection range from 10 to 100 µM along with a detection limit of 0.56 µM. Moreover, the practical applicability of the developed sensor was confirmed in real milk samples to test the consistency and accuracy of the sensor. In conclusion, the proposed method is a green, rapid, highly sensitive, and selective method for the detection of CIP in real milk samples, demonstrating the potential application of CDs in food detection.