China's fertilization practices contribute greatly to the global biogeochemical nitrogen (N) and phosphorus (P) flows, which have exceeded the safe-operating space. Here, we quantified the potentials of improved nutrient management in the food chain and spatial planning of livestock farms on nutrient use efficiency and losses in China, using a nutrient flow model and detailed information on >2300 counties. Annual fertilizer use could be reduced by 26 Tg N and 6.4 Tg P following improved nutrient management. This reduction N and P fertilizer use would contribute 30% and 80% of the required global reduction, needed to keep the biogeochemical N and P flows within the planetary boundary. However, there are various barriers to make this happen. A major barrier is the transportation cost due to the uneven distributions of crop land, livestock, and people within the country. The amounts of N and P in wastes and residues are larger than the N and P demand of the crops grown in 30% and 50% of the counties, respectively. We argue that a drastic increase in the recycling and utilization of N and P from wastes and residues can only happen following relocation of livestock farms to areas with sufficient cropland.