Locomotion and transport of microorganisms in fluids is an essential aspect of life. Search for food, orientation toward light, spreading of off-spring, and the formation of colonies are only possible due to locomotion. Swimming at the microscale occurs at low Reynolds numbers, where fluid friction and viscosity dominates over inertia. Here, evolution achieved propulsion mechanisms, which overcome and even exploit drag. Prominent propulsion mechanisms are rotating helical flagella, exploited by many bacteria, and snake-like or whip-like motion of eukaryotic flagella, utilized by sperm and algae. For artificial microswimmers, alternative concepts to convert chemical energy or heat into directed motion can be employed, which are potentially more efficient. The dynamics of microswimmers comprises many facets, which are all required to achieve locomotion. In this article, we review the physics of locomotion of biological and synthetic microswimmers, and the collective behavior of their assemblies. Starting from individual microswimmers, we describe the various propulsion mechanism of biological and synthetic systems and address the hydrodynamic aspects of swimming. This comprises synchronization and the concerted beating of flagella and cilia. In addition, the swimming behavior next to surfaces is examined. Finally, collective and cooperate phenomena of various types of isotropic and anisotropic swimmers with and without hydrodynamic interactions are discussed.