In the context of continuously improving agricultural innovation,competitiveness,and total factor productivity,the research empirically tests the impact of digital economy on agricultural total factor productivity using panel data from 273 prefecture-level cities in China from 2011 to 2019.The research findings are as follows:Firstly,the development of digital economy can significantly improve the agricultural total factor productivity;Secondly,technological progress and factor flow are the mechanisms through which the digital economy influences the agricultural total factor productivity,specifically via agricultural technological progress,agricultural labor transfer, agricultural land circulation,and agricultural capital deepening;Thirdly,there is heterogeneity in the role of the digital economy.Its impact on agricultural total factor productivity in the western region of China is not significant.Moreover,due to the shrinkage of major grain production areas and restrictive policies,the transfer of agricultural labor and the deepening effect of agricultural capital brought about by the digital economy are suppressed. Accordingly,policymakers should prioritize the digitization of agricultural infrastructure,lowering barriers to digital technology adoption,empowering agricultural technology innovation and application with digitalization,improving the management system of agricultural land transfer,and strengthening agricultural support policies in major grain producing areas.