PS-carbon dots (CDs) were prepared by a microwave-assisted method using protamine sulfate (PS), and they have dual functions of antibacterial and bacterial imaging.