Carbon quantum dots and metal-doped carbon quantum dots (N-CQDs and M-QDs) were prepared by the hydrothermal method. The samples were characterized by EDS, UV–Vis, FT-IR, XRD, and PL techniques. FT-IR investigation demonstrates that M-CQDs have a shift of the peak associated with C-O and C=O oxygen bonds due to doping metals into carbon quantum dots, and a band at 550 cm-1, which is related to M-O bonds. N-CQDs and M-CQDs exhibited impressive PL behavior as an antibacterial factor against representative Gram-negative and Gram-positive bacterial strains. According to the findings and comparisons of the average halo zone of the anti-bactericidal activity of the prepared samples and MIC methods, N-CQDs and M-CQDs demonstrate excellent prevention versus bacteria with the best MIC of 0.5 mg/L. Co-CQDs had the greatest inhibitory effect against S. aureus with an average halo zone diameter of 15 mm, and E. coli with an average halo zone diameter of 13 mm. This toxicity is due to the generation of reactive oxygen species and the interaction between the MCQDs and cells.