Microbial cells have developed sophisticated multicomponent structures and machineries to govern basic cellular processes, such as chromosome segregation, gene expression, cell division, mechanosensing, cell adhesion and biofilm formation. Because of the small cell sizes, subcellular structures have long been difficult to visualize using diffraction-limited light microscopy. During the last three decades, optical and force nanoscopy techniques have been developed to probe intracellular and extracellular structures with unprecedented resolutions, enabling researchers to study their organization, dynamics and interactions in individual cells, at the single-molecule level, from the inside out, and all the way up to cell–cell interactions in microbial communities. In this Review, we discuss the principles, advantages and limitations of the main optical and force nanoscopy techniques available in microbiology, and we highlight some outstanding questions that these new tools may help to answer.