The average lifespan of solar panels is about 25-30 years. However, this doesn't mean they stop generating electricity after this period; it rather refers to the "solar panel degradation rate", which is the rate at which power output decreases over time. On average, solar panels lose about 0.5%-1% of efficiency per year. So, they should still function beyond 30 years but at a lowered capacity.