The lifespan of an earthworm varies depending on the species and environmental factors. In general, most earthworms live for about one to six years. However, some species of earthworms can live much longer, up to 15 years or more. The lifespan of an earthworm can also be influenced by factors such as temperature, moisture, and soil quality.