As a key driver of high-quality economic development in the new era, the mechanism through which the digital economy influences industrial structure upgrading warrants in-depth investigation. Based on panel data from 31 provinces, autonomous regions, and municipalities directly under the central government in China from 2011 to 2021, this study employs a two-way fixed effects model to systematically examine the impact of the digital economy on the advancement and rationalization of industrial structure, with a particular focus on the mediating role of human capital and regional heterogeneity. The main findings are as follows: (1) The development of the digital economy significantly promotes both the advancement and rationalization of industrial structure. This conclusion remains robust after a series of robustness checks, including variable substitution. (2) Human capital accumulation serves as an important transmission channel through which the digital economy drives industrial structure upgrading, exhibiting a significant partial mediating effect. Specifically, the digital economy indirectly facilitates industrial structure optimization by enhancing the level of human capital. (3) There is notable regional heterogeneity in the impact of the digital economy on industrial structure upgrading. Compared with the eastern region, the digital economy exerts a more pronounced positive effect on industrial structure upgrading in the central and western regions, suggesting that these regions possess greater potential for industrial structure optimization through digital empowerment. This study provides novel empirical evidence for understanding the intrinsic relationship between the digital economy and industrial structure upgrading, and offers policy insights for tailoring digital economy development strategies to local conditions to accelerate industrial structure optimization and upgrading.