Mathematical analysis and modelling is central to infectious disease epidemiology. Here, we provide an intuitive introduction to the process of disease transmission, how this stochastic process can be represented mathematically and how this mathematical representation can be used to analyse the emergent dynamics of observed epidemics. Progress in mathematical analysis and modelling is of fundamental importance to our growing understanding of pathogen evolution and ecology. The fit of mathematical models to surveillance data has informed both scientific research and health policy. This Review is illustrated throughout by such applications and ends with suggestions of open challenges in mathematical epidemiology.