Cell motility in viscous fluids is ubiquitous and affects many biological processes, including reproduction, infection and the marine life ecosystem. Here we review the biophysical and mechanical principles of locomotion at the small scales relevant to cell swimming, tens of micrometers and below. At this scale, inertia is unimportant and the Reynolds number is small. Our emphasis is on the simple physical picture and fundamental flow physics phenomena in this regime. We first give a brief overview of the mechanisms for swimming motility, and of the basic properties of flows at low Reynolds number, paying special attention to aspects most relevant for swimming such as resistance matrices for solid bodies, flow singularities and kinematic requirements for net translation. Then we review classical theoretical work on cell motility, in particular early calculations of swimming kinematics with prescribed stroke and the application of resistive force theory and slender-body theory to flagellar locomotion. After examining the physical means by which flagella are actuated, we outline areas of active research, including hydrodynamic interactions, biological locomotion in complex fluids, the design of small-scale artificial swimmers and the optimization of locomotion strategies.