Clostridium difficile infection (CDI) continues to affect patients in hospitals and communities worldwide. The spectrum of clinical disease ranges from mild diarrhoea to toxic megacolon, colonic perforation and death. However, this bacterium might also be carried asymptomatically in the gut, potentially leading to 'silent' onward transmission. Modern technologies, such as whole-genome sequencing and multi-locus variable-number tandem-repeat analysis, are helping to track C. difficile transmission across health-care facilities, countries and continents, offering the potential to illuminate previously under-recognized sources of infection. These typing strategies have also demonstrated heterogeneity in terms of CDI incidence and strain types reflecting different stages of epidemic spread. However, comparison of CDI epidemiology, particularly between countries, is challenging due to wide-ranging approaches to sampling and testing. Diagnostic strategies for C. difficile are complicated both by the wide range of bacterial targets and tests available and the need to differentiate between toxin-producing and non-toxigenic strains. Multistep diagnostic algorithms have been recommended to improve sensitivity and specificity. In this Review, we describe the latest advances in the understanding of C. difficile epidemiology, transmission and diagnosis, and discuss the effect of these developments on the clinical management of CDI.