Bacteriocins are potent antimicrobial peptides that are produced by bacteria. Since their discovery almost a century ago, diverse peptides have been discovered and described, and some are currently used as commercial food preservatives. Many bacteriocins exhibit extensively post-translationally modified structures encoded on complex gene clusters, whereas others have simple linear structures. The molecular structures, mechanisms of action and resistance have been determined for a number of bacteriocins, but most remain incompletely characterized. These gene-encoded peptides are amenable to bioengineering strategies and heterologous expression, enabling metagenomic mining and modification of novel antimicrobials. The ongoing global antimicrobial resistance crisis demands that novel therapeutics be developed to combat infectious pathogens. New compounds that are target-specific and compatible with the resident microbiota would be valuable alternatives to current antimicrobials. As bacteriocins can be broad or narrow spectrum in nature, they are promising tools for this purpose. However, few bacteriocins have gone beyond preclinical trials and none is currently used therapeutically in humans. In this Review, we explore the broad diversity in bacteriocin structure and function, describe identification and optimization methods and discuss the reasons behind the lack of translation beyond the laboratory of these potentially valuable antimicrobials.