The rational and efficient use of cropland is a crucial way to stabilize the balance between food supply and demand, ensure sustainable agricultural development, and guarantee national food security. However, there has been a tendency for non-grain planting of cultivated land in recent years. Investigating the driving factors of farmers' non-grain planting in hilly and mountainous areas is meaningful. This study extended the Theory of Planned Behavior (TPB) by introducing the variable of risk-carrying capacity, and the results supported that the integrative model was more efficient in explaining non-grain production behavior. Farmers' risk-carrying capacity and subjective norm were the most critical determinants of their planting behavioral intention. Besides, attitude, subjective norm, and perceived behavioral control mediated the paths of risk-carrying capacity to farmers' non-grain crops growing intention. Most importantly, there were differences in the behavior mechanism of farmers of different ages and working statuses. These findings provided a clear evidence understanding of farmers' non-grain planting behavior and could help program planners design policy interventions.