Improving the total factor productivity (TFP) of animal husbandry enterprises is the key to promoting the sustainable development of animal husbandry. Technological progress is an important driving force for improving the TFP of animal husbandry enterprises, and research and development (R&D) investment determines the speed of technological progress. Based on the data of Chinese animal husbandry enterprises listed on Shanghai and Shenzhen A-shares in China between 2009 and 2022, this article empirically analyzes the impact of R&D investment on the TFP of animal husbandry enterprises and the moderating role of executive incentives in it and discusses the heterogeneity of this impact, using the fixed-effects model. It is found that R&D investment has a significant positive impact on the TFP of animal husbandry enterprises, and the TFP of animal husbandry enterprises increased by 0.00105 for every 1% increase in R&D investment. Equity incentives for executives positively moderated the relationship between R&D investment and the TFP of animal husbandry enterprises, while executive compensation incentives negatively moderated the relationship. Heterogeneity analysis shows that R&D investment has a significant effect on the TFP of non-state-owned animal husbandry enterprises, but has no significant impact on the TFP of state-owned animal husbandry enterprises. The impact of R&D investment on TFP showed a significant promotion in the livestock and poultry breeding and meat product processing industries, but not in the feed production, dairy product processing and animal health industries. R&D investment has a significant effect on the TFP of animal husbandry enterprises in Eastern China and Central China, but has no significant impact on the TFP of animal husbandry enterprises in Western China.