Infertility is a global health problem affecting one in six couples, with 50% of cases attributed to male infertility. Spermatozoa are male gametes, specialized cells that can be divided into two parts: the head and the flagellum. The head contains a vesicle called the acrosome that undergoes exocytosis and the flagellum is a motility apparatus that propels the spermatozoa forward and can be divided into two components, axonemes and accessory structures. For spermatozoa to fertilize oocytes, the acrosome and flagellum must be formed correctly. In this Review, we describe comprehensively how functional spermatozoa develop in mammals during spermiogenesis, including the formation of acrosomes, axonemes and accessory structures by focusing on analyses of mouse models.