Landscape heterogeneity is considered a promising option for building resilient and sustainable agroecosystems. Understanding the relationships between farmland soil organic carbon (SOC) and landscape heterogeneity can support soil carbon sequestration and better serve food security and climate change. However, the influence extent and optimal scale of farmland landscape heterogeneity (i.e. landscape composition and landscape configuration heterogeneity) on SOC remains unclear. In this study, we established the relationships between multi-scale landscape heterogeneity and SOC in a typical grain-production county of northeast China. Stepwise regression results showed that when the buffer radius was 2000 m, the interpretation of SOC by landscape heterogeneity was the largest. The effects of landscape composition and landscape configuration on SOC were further decomposed by Variance Partitioning Analysis, and we found that independent interpretation ability of landscape configuration (8%) exceeded landscape composition (7%). The result of soil mapping combined with landscape indexes also showed that landscape configuration contributed more to the increased accuracy. Moreover, we found that correlation between configuration indexes and SOC at the class level was less related than that at the landscape level, among which the two most important indexes were Mean Fractal Dimension Index (FRAC_MN) and Number of Patches (NP). FRAC_MN was even more important than natural factors, indicating the validity of landscape as an indicator of human activities should not be ignored when considering farmland SOC. Overall, the results of this study revealed that the negative effects of agricultural intensification on SOC can be buffered to a certain extent by increasing the complexity of patch shape and reducing the degree of landscape fragmentation at the landscape level, providing hope for the sustainable development in intensive agricultural areas. In addition, due to the scale effect of landscape heterogeneity on farmland SOC, we suggest that decision makers should consider the spatial scale in landscape allocation and planning. This study provides a scientific reference for realizing the balance between grain production and ecological function in intensive agricultural areas.