Under the dual structure of urban and rural lands, revitalizing rural idle homesteads is an effective measure for reducing resource waste and improving the efficiency of rural land use. Therefore, the intention of farmers, as the primary decision-makers in revitalizing rural idle homesteads, is the key to the success of revitalizing idle homesteads. With an analytical framework based on the theory of planned behavior (TPB), this study used multiple linear regressions to analyze the survey data (N = 680). The results showed that attitude toward the behavior (AB), subjective norms (SN), and perceived behavioral control (PBC) had significant positive effects on the farmers’ intention to revitalize, with SN, PBC, and AB in descending order of influence. It confirmed that the TPB applies to the study of farmers’ intention to revitalize idle homesteads in the context of China. In addition, this study focused on the social phenomenon of farmer differentiation, which is prominent in the urbanization process. It emphasizes the moderating effect of farmer differentiation on the relationships of “attitude toward the behavior–intention to revitalize,” “subjective norm–intention to revitalize,” and “perceived behavioral control–intention to revitalize,” and further improves TPB. The present empirical study using hierarchical regression found that the deeper the differentiation of farmers, the stronger the effective influence of AB, SN, and PBC on farmers’ intention to revitalize idle homesteads. Therefore, it is suggested that the Chinese government should enhance farmers’ intention to revitalize by cultivating a positive attitude toward the behavior, strengthening the positive influence of subjective norms on farmers, and enhancing farmers perceived behavioral control. Furthermore, it is more important to pay full attention to the phenomenon of farmer differentiation and design a revitalization policy according to the differences in sensitivity of different types of farmers to attitudes toward the behavior, subjective norms, and perceived behavioral control.