Abstract:[Objective] The farmland ecological compensation amounts were calculated from the perspectives of food security and “double carbon”. The geographical space and economic contribution degree of the upper, middle, and lower reaches of the basin were comprehensively considered to divide the ecological compensation areas, in order to provide a theoretical reference for the construction of high-standard farmland, low-carbon agricultural development, and improvement of the benefit compensation mechanism in the basin.[Methods] We measured the profits and losses of farmland in 60 cities within the Yellow River basin from the perspective of food security, established a standard for farmland ecological compensation based on the opportunity cost method, calculated carbon emissions from agricultural resources used in production and crop growth across these cities, estimated total carbon absorption through photosynthesis during crop growth, and determined the net carbon sink of farmland in this region by considering both sources and sinks. The average carbon trading price in 2021 served as the compensation standard for calculating regional farmland ecological compensation from a “dualcarbon” perspective. Finally, by calculating farmland ecological compensation amounts separately under perspectives of food security and “doublecarbon”, we obtain comprehensive figures for dual-perspective ecological compensation within the Yellow River basin. [Results] Most cities in Qinghai and Henan provinces, where the Yellow River flows, accept certain compensation levels. Provincial capitals such as Xi’an, Zhengzhou, and Taiyuan City need to pay higher amounts due to their significant urbanisation level, industrialisation progress, and robust economic development. These findings highlighted a more pronounced conflict between local farmland security and food and ecological security. [Conclusion] In constructing high-standard farmland, carbon emissions and carbon absorption in the agricultural production process should be considered to ensure food security and to make farmland ecological compensation more reasonable, to achieve the goal of “dualcarbon” in China and to help the construction of powerful agricultural country.