The average lifespan of a rat typically ranges from 2 to 3 years. However, with proper care and a controlled environment, some rats can live up to 4 or 5 years. Factors such as genetics, diet, and living conditions can influence their lifespan.