Bacterial microcompartments (BMCs) are self-assembling organelles that consist of an enzymatic core that is encapsulated by a selectively permeable protein shell. The potential to form BMCs is widespread, found across the Kingdom Bacteria. BMCs have crucial roles in carbon dioxide fixation in autotrophs and the catabolism of organic substrates in heterotrophs. They contribute to the metabolic versatility of bacteria, providing a competitive advantage in specific environmental niches. Although BMCs were first visualized more than sixty years ago, it is mainly in the last decade that progress has been made in understanding their metabolic diversity and the structural basis of their assembly and function. This progress has not only heightened our understanding of their role in microbial metabolism but it is also beginning to enable their use in a variety of applications in synthetic biology. In this Review, we focus on recent insights into the structure, assembly, diversity and function of BMCs.