Main

The global population continues to rise and require ever-greater quantities of food1, while urbanization has increasingly separated food production and consumption2. Nutrient flows through rural agricultural production and urban food and water systems could enhance or jeopardize future global sustainability, as manifested in contexts including urban metabolism studies3,4, the circular economy5,6 and the United Nations’ Sustainable Development Goals7. Over the past century, synthetic fertilizers have supplied agricultural nutrients to enable dramatic expansions in food production8,9. However, phosphorus and potassium fertilizer production depends on regionally concentrated, non-renewable supplies of phosphate rock and potash ores8,10, while converting atmospheric nitrogen gas into ammonia fertilizer through the Haber–Bosch process is energy intensive. On reaching farmland, excessive fertilizer application can lead to water contamination, algal blooms and eutrophication11.

Alternatively, nutrients in human excreta, most of which are not currently recycled to cropland (for example, <15% of excreted nitrogen)12,13,14, could offset globally meaningful quantities of synthetic fertilizer use and advance food security goals by increasing nutrient access in low-income countries15,16. National strategies in countries such as Rwanda are promoting resource recovery17, while global agencies advocate for sustainable water and sanitation systems, urban environments and consumption patterns (Sustainable Development Goals 6, 11, 12)7. Simultaneously, international research collaborations estimate that anthropogenic nutrient flows already exceed planetary boundaries and assert that these grand challenges require systems-wide transformations (including nutrient recycling)18,19,20.

Urban areas represent critical contexts for nutrient recovery, food security and sustainability. They can act as either centres of innovation or focal points for environmental deterioration21. Urban settings now contain over 50% of the global population (including nearly 500 cities with populations >1 million and 28 megacities with populations >10 million)22, and they may house 6.3 billion by 205022. As urban agriculture (limited by available land) accounts for a small fraction of urban diets23, cities rely on rural food production2,21, transporting in nutrients for consumption. Rather than allowing these nutrients to pass through urban metabolisms and pollute local environments13, recovery from urban sanitation represents a potential link to close nutrient cycles between cities and rural agriculture24. From local businesses finding profits from human waste in Kigali and Accra25 to Ostara’s 17 struvite recovery installations serving 11.5 million people across North America and Europe26, planners and entrepreneurs are experimenting with systems to capitalize on the resources in urban sanitation.

However, while various recovery technologies have been developed and implemented27,28, roadmaps to help cities make informed decisions are often non-existent, particularly regarding the challenge of finding markets for recovered products29,30. For cities, the distances between nutrient recovery and agriculture are a key factor in these markets31, potentially constraining recovery technology choice and feasibility due to transport energy requirements. Long transport distances may make reuse of products with relatively low nutrient content (for example, reclaimed wastewater) prohibitively expensive31, placing greater pressure on cities to recover highly concentrated products (for example, struvite) using more complex processes. Therefore, there is a critical need to characterize the co-location of urban nutrients with cropland where they can be applied. However, beyond findings specific to certain crops, locations or nutrients (for example, 74% of United States corn’s phosphorus demand could be met using in-county recyclable sources31), studies analysing nutrient co-location across diverse urban areas are lacking21. These analyses would provide valuable information surrounding the feasibility of nutrient recycling, elucidating strategies for harmonizing urban wastewater management with agricultural needs32.

Accordingly, we undertook an exploratory exercise to characterize the spatial co-location of cropland and recoverable human-derived nutrients from major urban centres to define paths forward for closing urban nutrient cycles. For 56 of the world’s largest urban agglomerations (hereafter referred to as cities) across 6 continents (Supplementary Tables 1 and 2), we defined urban extents and estimated total nitrogen, phosphorus and potassium quantities recoverable from human excreta (typically the largest source of nutrients entering urban sanitation13,33; Supplementary Methods 1 and Supplementary Table 3). Using crop-specific fertilizer recommendations (Supplementary Table 4), we then characterized the distances nutrients must travel to satisfy crop demands (Supplementary Methods 2 and Supplementary Figs. 13). Additionally, we assessed sensitivity to changing nutrient supplies and multiple sanitation infrastructure configurations (Supplementary Table 5; sensitivity of recoverable nutrient quantities to recovery efficiency has been evaluated previously16). Furthermore, to guide decision makers, we estimated (1) how shifts in existing crop patterns can reduce distances (Supplementary Table 5) and (2) how recovering more concentrated nutrient products can reduce transport energy requirements. Ultimately, this exercise enables us to identify broad patterns and locations where nutrient recovery strategies and products may be most able to advance the circular economy, creating opportunities for future context-specific studies to promote nutrient recycling and boost rural productivity through cooperation between urban water and regional agriculture systems.

Results and discussion

Nutrient travel distances in 2000

Based on city population distributions, crop patterns and nutrient recovery potentials from sanitation in the year 2000 (primary scenario), travel distances to apply nutrients to cropland vary widely across 56 cities (Fig. 1 and Supplementary Table 6). Average nitrogen distances (average distance per kilogram for complete application of all recoverable nitrogen; Supplementary Equation 4) span approximately 2 orders of magnitude, ranging from 6 km (Rome) to 329 km (Boston). Moreover, among some cities in Brazil (Rio de Janeiro, Sao Paulo), Japan (Osaka-Kobe, Tokyo) and the United States (Boston, New York–Newark, Philadelphia, Washington, DC), application areas from multiple cities overlap, suggesting their distances may be longer if recovery is broadly pursued.

Fig. 1: Distributions of nutrient transport distances for 56 cities in 2000.
figure 1

Distributions of nitrogen, phosphorus and potassium travel distances for 56 cities across 6 continents in 2000, ordered by average nitrogen distances (average distance per kilogram for complete application of all recoverable nitrogen; Supplementary Equation 4). As shown in the inset example (upper right), each box-and-whisker distribution shows the distance various mass fractions of a city’s total recoverable nutrients (5% (left end of whisker), 25% (left edge of box), 50% (median line in box), 75% (right edge of box), 95% (right end of whisker)) must travel to be fully applied. All distances are from the primary scenario. The continent of each city is shown on the left. Supplementary Table 6 provides all numerical results. *Multi-city urban agglomerations (Dallas–Fort Worth, Los Angeles–Long Beach–Santa Ana, New York–Newark, Osaka–Kobe) appear under a single city name to reduce figure width.

Higher local cropland density (cropland relative to land area) was the factor most associated with shorter average distances (average cropland density was computed within 10, 50 and 100 km of city boundaries; in all cases, P <0.0001; Supplementary Table 7). As a rough indication of this factor’s impact, a simple linear regression estimated that a 1% increase in cropland density within 50 km of city boundaries correlates with a decrease in average nitrogen distance of 1.6 km (95% confidence interval, 1.0–2.2 km; Supplementary Table 8). Disparities in distances also reveal that cities in Europe, Africa and Asia typically exhibit shorter distances than cities on other continents (for example, P <0.001 for nitrogen; mean of average nitrogen distances across cities in Europe, Africa and Asia: 40 km; mean in South America, Oceania and North America: 91 km; Supplementary Tables 9 and 10). These differences probably connect to variations in cropland density. The mean cropland density within 50 km of cities in Europe, Africa and Asia is more than twice that of cities on other continents (P <0.001).

Beyond cropland density, nutrient distances may relate to additional factors, including crop nutrient demand ratios, population density, city area, coasts, city population and food supply and a country’s per capita gross domestic product (GDP). Despite large variations across cities, potassium distances are nearly always shortest (followed by phosphorus and then nitrogen) due to imbalances between the ratios of nutrients required by many crops and the typical ratios in human excreta. Compared with many crops’ recommended N:P:K application ratios (for example, 1:0.25:1.27 for wheat; Supplementary Table 4), typical ratios of nutrients excreted by humans are higher in nitrogen and lower in phosphorus and potassium (global average of 1:0.14:0.29; although processes such as anaerobic digestion can result in substantial nitrogen losses, altering ratios in recovered products)16,34. Therefore, crop nitrogen demand in a given location is often met first (so that nitrogen must travel farther), while a given cropland area can often absorb a greater fraction of human-derived potassium.

While distance variations seem most directly related to the prevalence and type of local crops, they may also be partly associated with population density and city area (Supplementary Fig. 3). Cities with larger areas and smaller population densities, suggesting urban sprawl35, are associated with lower cropland densities within 50 km of city boundaries (P <0.001). City area also relates to the sensitivity of nutrient distances to assumptions regarding sanitation system configuration. Our primary results assumed that sanitation systems were distributed throughout each city in a somewhat decentralized configuration, with 1 system per 100-km2 grid cell. If all nutrients are instead recovered at one centralized location (centralized scenario), distances to cropland almost always increase (Supplementary Fig. 4). The magnitude of this change is positively associated with city area (P <0.001), as nutrients centrally collected must often travel farther to reach rural cropland. However, these increases do not fundamentally alter overarching patterns broadly evident across cities.

Coastal cities (within 100 km36 of oceans or major freshwater bodies) may exhibit longer average distances (P = 0.01–0.03 across all nutrients; Supplementary Table 9), as nutrient movement is constrained by coastlines. When analysing each continent individually, coastal characteristics may play a role in Asia (P = 0.02–0.05), where the longest distances are associated with coastal cities (for example, Tokyo, Osaka-Kobe, Karachi). Overall, however, coasts appear to be less critical than continental differences, with non-coastal cities in the Americas (for example, Mexico City, Belo Horizonte) still exhibiting longer distances than most African, Asian and European cities. Local cropland density again appears to factor prominently, as differences in the average cropland densities of coastal and non-coastal cities were minor (P = 0.15), while larger disparities were observed across continents.

The role of city population

Key in determining nutrient distance is a city’s total population (see Fig. 2 for nitrogen, Supplementary Figs. 5 and 6 for phosphorus and potassium). With more people come greater nutrient quantities more likely to saturate local cropland. For example, Tokyo and Osaka-Kobe are associated with long distances partly because they are two of the world’s most populous cities. Inversely, smaller cities such as Lisbon, Kano and Abidjan exhibit short distances.

Fig. 2: Recoverable nitrogen quantities and average transport distances.
figure 2

Total recoverable nitrogen quantities compared with mass-weighted average nitrogen distances (for 100% application to cropland) for all cities. a, Each point shows results from the primary scenario (in 2000). b, Each city’s average nitrogen distance per 1,000 tonnes of nitrogen applied, grouped by continent. For each continent, the left vertical grouping shows values from the primary scenario (labelled ‘2000’), while the right grouping shows results from the increased population/affluence scenario (labelled ‘2030’ for simplicity). Larger white symbols represent mass-weighted averages for each continent (average distance per 1,000 t N applied from all cities in that continent, weighted according to each city’s total recoverable nitrogen). Phosphorus and potassium results, which follow similar trends, are displayed in Supplementary Figs. 5 and 6.

This pattern does not always hold, however, and continental grouping still appears to play a strong role (Fig. 2). Many African, European and especially Asian cities exhibit short distances relative to total nutrient quantity, while most Oceanic cities have exceptionally long distances for their small sizes. The four least populous cities are all in Oceania, but, except for Adelaide, they exhibit some of the longest nutrient distances. Inversely, larger Asian cities (for example, Dhaka, Kolkata) tend to be associated with shorter distances, as they are often surrounded by high densities of nutrient-intensive crops. Although Asia’s two most populous cities in 2000 (Tokyo, Osaka-Kobe) exhibit long distances, their average distances per 1,000 t nutrient applied are comparable with the rest of Asia and much lower than those of other smaller cities (for example, Auckland, Boston). These trends suggest that reuse may be beneficial among some larger cities, even when average distances are not particularly low (for example, Mexico City). Indeed, the association between distance and population is relatively weak (for example, P = 0.04 for nitrogen; Supplementary Table 7) compared with the impact of cropland density (P <0.001). Along with cropland density, identifying contexts most conducive to reuse will probably also depend on the types of crops being grown, affected by local characteristics such as climate, topography and soil quality.

At national scales, recoverable nutrients from some large cities could replace sizeable fractions of fertilizer imports, although global fertilizer trade can be volatile and may change with large-scale nutrient recovery. Examining data from 2000 to 201037, Cairo’s recoverable nutrients could have offset all of Egypt’s annual phosphorus fertilizer imports and 23–70% of imported potassium (Egypt’s net food imports (that is, imports less exports) were 9–20% of total food supply by mass; Supplementary Table 11). In Japan (where net food imports represented 46–49% of food supply), Tokyo and Osaka-Kobe together could have replaced >72% of nitrogen fertilizer imports, while recovery in Buenos Aires could have offset >25% of potassium fertilizer imports in Argentina (a net food exporter). Smaller cities in low-income nations may provide a similar function. On average, recovery in Khartoum could have offset 73% of potassium fertilizers imported by Sudan (where net food imports represented 3–11% of food supply), although complete reuse would require long travel distances. Given the substantial yield gaps observed in Sub-Saharan Africa38, however, recovered nutrients may function to supplement (rather than offset) imported fertilizers.

Rising populations and food supplies (considered to 2030 in the increased population/affluence scenario; other factors including urban extent and land use are held constant to assess sensitivity specific to changing nutrient supplies) will greatly increase recoverable nutrients in many cities, particularly in Africa and Asia (except Japan, due to low growth projections). At the most extreme, nitrogen quantities in Kinshasa and Lagos are projected to quadruple from 2000 to 2030 (based on population and food supply projections22,39; Supplementary Methods 1). However, average distances per mass of nutrient typically decrease or remain similar to values from the primary scenario (Fig. 2). While distances must rise to accommodate larger nutrient quantities, distance typically increases to a lesser degree than quantity, as cropland density often intensifies further from cities. In Africa and Asia, with rapidly growing urban populations and substantial agriculture near cities, reductions in distance per unit mass are especially pronounced (36% average reduction in Africa, 30% in Asia), suggesting that nutrient reuse may become increasingly efficient with rising population and affluence. In contrast, average distance per unit mass decreases by about 10% in Europe, where smaller population/affluence changes are expected. However, this sensitivity analysis is limited in that it does not consider changes in urban extent or land use. By 2030, urban expansion may displace approximately 2% of global cropland, but local impacts could be more substantial around certain cities in Africa and Asia (for example, Alexandria, Kolkata)40, affecting reuse possibilities and necessitating adaptive decision making.

Locations interested in exploring nutrient recycling may consider approaches to reduce nutrient transport distances and energy requirements. Below, we consider possibilities related to (1) altering local crop patterns and (2) implementing sanitation technologies that generate concentrated nutrient products.

Impacts of altering local crop patterns

Crop type is critical in determining nutrient demands of surrounding cropland, and growing more nutrient-intensive options could reduce nutrient distances. Acknowledging that crop choice should consider several factors involving climate, soil, topography, economics and other local conditions, we performed a hypothetical exercise to assess the impact of altering crop patterns to optimize for nutrient distance. Essentially, we evaluated the sensitivity of nutrient distances to crop type. Various crops could be chosen (for example, nutrient-intensive vegetables, commonly grown in urban agriculture due to their perishability and nutritional benefits23; Supplementary Table 4), but we limited our analysis to each country’s nationally important crops (already grown on >10% of cropland), assuming that these crops may represent viable alternatives for farmers. We replaced existing crops with the most nutrient-intensive nationally important crop wherever it would increase nutrient demand (Supplementary Table 5). As N:P:K ratios differ, a specific crop was selected to optimize for each nutrient in the country.

Depending on existing and available replacement crops, some cities could dramatically reduce nutrient distances (Supplementary Fig. 7). In southern Europe, many cities could reduce already short distances by replacing local crops with olives, which demand high inputs of all three nutrients. For example, Rome could reduce average nitrogen distance up to 76% if olives replaced all existing local crops. Plantains (nationally important in Colombia) also demand high levels of all three nutrients. Consequently, Bogota could reduce average distances up to 47% (N), 66% (P) and 80% (K). In Nigeria, nationally important crops are limited to sorghum and millet, which are not particularly nutrient intensive. However, as sorghum demands more nitrogen and potassium, Kano’s nutrient distances could be reduced by replacing locally grown millet with sorghum. Lagos, where oil palm (nutrient intensive but covering <10% of Nigeria’s cropland) is common, would not see similar benefits. Likewise, shifting crop patterns where nutrient-intensive, nationally important crops are already common (for example, rice around Dhaka, Osaka-Kobe and Tokyo) would not create meaningful change.

These findings should be interpreted with caution, as altering crop patterns to reduce nutrient distance may conflict with other important factors and could be inadvisable. These factors include: economics (for example, shifting to more nutrient-intensive crops may be less profitable than maintaining current practices), food security (for example, shifting to cotton around Karachi may reduce food access in Pakistan, where 44% of children are stunted41), resource-efficient crop rotation systems (for example, maize–soy rotations near Chicago should not be abandoned to grow only maize), tensions between farmer-level concerns (for example, economic and resource productivity) and system-level issues (for example, water and land footprints)42 and local climate, soil and topographic conditions. Thus, improving conditions for nutrient recycling may require other approaches.

Impacts of nutrient recovery products

Recovering nutrients in more concentrated forms may also increase reuse feasibility by reducing the mass that must be transported a given distance (thereby reducing energy requirements). Depending on the sanitation technologies employed, nutrients are recovered in products of varying composition (Fig. 3). Along with travel distance, each product’s nutrient content determines whether it represents an energetically (and, to an extent, economically) favourable alternative. For simplicity, we compared transport with different products over each city’s average nutrient distances (primary scenario) as a representative case. Using each product’s nutrient content and the energy consumption of road freight vehicles (or pumping, for recovered wastewater; Supplementary Table 12), distances were converted to transportation energy estimates (to visualize general trends, Fig. 3 shows ranges encompassing all cities). Furthermore, estimating global energy demands of synthetic fertilizer production and distribution offers a point of comparison (Fig. 3).

Fig. 3: The impact of recovery product on transport energy requirements.
figure 3

Transport energy per tonne of nutrient applied using different recovery products across all cities. a, The relative fractions of nitrogen, phosphorus and potassium typically contained in each product are shown, with total nutrient content (N + P + K) relative to each product’s total mass represented by the percentages along the top. b, Each bar represents the range of energy values across all 56 cities, calculated from representative distances (each city’s average distance for each nutrient), nutrient concentrations in recovery products (mass of N, P or K per total mass) and estimates of transport energy per tonne-kilometre. The full range accounts for uncertainty around each product’s nutrient composition and transport energy requirements (minimum to maximum value, inclusive of uncertainty for all 56 cities). The light-purple region extending horizontally through b shows the range of estimated energy demands for production and transport across all single-nutrient synthetic fertilizers (global averages), allowing for comparisons between nutrient reuse and synthetic fertilizers. Supplementary Fig. 8 shows individual results for each city. Supplementary Table 12 provides details regarding the nutrient composition and energy values used in the calculations.

Wastewater treated to reduce organic matter and pathogens (but not nutrients) can irrigate cropland (‘fertigation’, providing combined nutrient and water recovery, particularly useful where water limitations constrain crop production)24 but is relatively dilute43. Although pumping consumes far less energy than trucking per unit mass and distance, recovered wastewater requires more energy than other products because nutrients constitute <0.01% of its total mass (Fig. 3). Additionally, as its large volume precludes storage, wastewater application typically must occur immediately after treatment and delivery. In contrast, dewatered sludge (15–28% solids) has higher nutrient concentrations43 (but also higher nitrogen losses during digestion, not considered in our recovery potentials) and could be stored until appropriate application times. Sludge provides opportunities particularly for phosphorus reuse, while being less competitive for potassium (Supplementary Fig. 8). Urine is especially nitrogen rich34, but it also provides opportunities for other nutrients. However, urine reuse may be infeasible where a conventional sewer infrastructure is in place (resulting in mixed waste streams).

Crystal products—dried solids including ammonium sulfate, ammonium struvite and potassium struvite44,45,46—represent the most concentrated form of recoverable nutrients from mixed waste streams, enabling storage and more distant transport. Most common is ammonium struvite (MgNH4PO4·6H2O), a mineral precipitate containing high phosphorus levels but no potassium44, while ammonium sulfate ((NH4)2SO4) and potassium struvite (KMgPO4·6H2O) enable concentrated nitrogen and potassium recovery. For all crystal products, expected transport energies fall below global averages of synthetic fertilizer production and distribution, even among cities with long distances (Supplementary Fig. 8), suggesting that these locations may still benefit energetically from agricultural reuse if recovery of highly concentrated products is feasible. However, crystal products’ economic viability may be limited in certain locations (for example, high magnesium costs in Nepal have hindered ammonium struvite systems44), and they require additional energy for recovery (for example, roughly 21 MJ per kg phosphorus for ammonium struvite precipitation47, which is substantial relative to transport energy but would not push any cities past the phosphorus fertilizer energy threshold). Generally, choosing appropriate technologies and products will depend on capital and operating expenses (for example, precipitation reactors, chemical addition), existing sanitation infrastructure (for example, level of centralization, conveyance systems), treatment process configuration (for example, existence of side streams including anaerobic digester supernatant) and wastewater and side stream composition (for example, potassium struvite precipitation must follow ammonium oxidation)43,44,46. Furthermore, technology selection should occur in collaboration with farmers, ensuring end users will accept and value recovered products29.

Limitations

The results of this exercise should be taken as first-order estimates of nutrient transport distances across 56 cities, useful for identifying broad trends and locations that may warrant further investigation into reuse strategies. Various limitations suggest possible avenues for future research that will improve accuracy and prioritize opportunities to link urban and agricultural metabolisms. First, the primary scenario is based on distributions of population, crop demands and estimated nutrient recovery potentials from 2000. Each dataset is associated with uncertainty, and many cities have expanded considerably since 2000. We also assumed that nutrients could not cross national borders, but international transfers may be relevant for metropolitan regions near or extending across boundaries (for example, Tijuana–San Diego, East Africa’s Lake Victoria region). Furthermore, this analysis approximated urban sanitation facility locations, with 1 facility per 100-km2 area. We challenged this assumption by repeating the exercise with one facility per city. Some cities were sensitive to facility location, but general patterns remained consistent (Supplementary Fig. 4). Each city’s true sanitation network probably falls between these two bounding scenarios. Globally, while many cities have centralized infrastructure, nearly 30% of global urban residents use onsite sanitation systems (potentially associated with sludge collection, transport and semicentralized treatment)48. Aspirationally, the exercise assumes complete sanitation coverage in cities, but achievable near-term nutrient recovery will depend on spatially explicit sanitation access, which can vary widely within subnational regions due to wealth and other factors48. Additionally, the definition of urban extent remains uncertain, especially for cities with growing populations. Generally, these limitations reflect the need for more accurate, temporally resolved data and definitional clarity on urban extent and infrastructure23,49 to better estimate the characteristics and requirements of nutrient reuse in future, context-specific studies.

Implications

This analysis studied trends across a diverse set of 56 large cities, identifying locations where recirculation of human-derived nutrients may be spatially feasible and considering strategies to reduce transport distance and energy. It shows that universal promotion of agricultural nutrient reuse may sometimes be impractical (though concerns such as eutrophication provide alternative support for nutrient recovery). Rather, settings with characteristics including high local cropland density and compact urban area (for example, Alexandria, Dhaka, Kolkata, Kano) should be identified and assessed for their potential to optimize nutrient reuse. Here, we have considered nutrient recovery and agricultural reuse as an additional process connected with existing or future sanitation treatment, estimating transport requirements of moving recovered nutrients to cropland. Our findings should be complemented with place-based studies able to holistically consider specific systems, and they offer a starting point for policy-makers, funding agencies, agricultural researchers and practitioners, development professionals and utilities. Overarching patterns regarding reuse feasibility, intervention strategies and the magnitude of potential opportunities and challenges provide insight to layer on top of locality-specific decision-making processes that consider current sanitation infrastructure, regulations, energy and labour requirements and local agriculture.

Recycling nutrients from human sanitation can reduce global reliance on synthetic fertilizers and provide greater nutrient access in resource-limited settings16. The world contains at least two billion smallholder farmers typically living in lower-income countries40, with yields often constrained by nutrient and water limitations38. Many smallholders live in Africa and Asia50, two of the three continents (along with Europe) typically containing cities with shorter nutrient distances (Figs. 1 and 2; although cropland in Africa and Asia may be more vulnerable to future urban land expansion40). Lower per capita GDP is associated with shorter average distances (P = 0.002–0.02; Supplementary Table 7), suggesting opportunities to support smallholder farmers through nutrient reuse. Where feasible, increasing linkages between cities and rural cropland by recirculating human-derived nutrients could improve farmers’ economic and food security, reduce urban discharges to the environment, increase national food system resilience against international fertilizer and food price spikes and motivate sanitation improvements where access is limited13,24,33,40.

Methods

Agricultural nutrient requirements

Spatial distributions of crop nutrient requirements were estimated using global harvested areas of crops from the year 2000 (5 × 5 arcmin cell resolution, or approximately 10 × 10 km2 at the equator)51 and median recommended nitrogen, phosphorus and potassium application rates for each crop (Supplementary Table 4)52. Fifty-two crops were considered to be nationally important, defined here as constituting at least 10% of the total crop area in any given country (determined using Food and Agriculture Organization data)37, and were directly included in the calculations that produced the overall distribution of agricultural nutrient requirements. Within each grid cell, the total nitrogen, phosphorus and potassium requirements across all 52 crops were determined by summing the products of individual crop area and crop-specific nutrient requirements. The total nutrient demands for each grid cell were then estimated by dividing these values (the total N, P and K requirements for the 52 crops) by the fraction of a country’s total harvested crop area attributed to these 52 crops37. The 52 nationally important crops accounted for 90% of all cropland area, both globally and across the 31 countries containing the 56 cities included in our analysis. However, it is worth noting that some nutrient-intensive crops not classified as nationally important (for example, specialty fruits and vegetables) may be grown around cities, potentially reducing estimated nutrient distances.

City extents and recoverable nutrients

To ensure the analysis included cities from geographically diverse regions, the ten most populous cities from each inhabited continent (based on total population in the year 2000, as reported in the United Nations World Urbanization Prospects22) were selected from a spatial database of large urban areas22,53. As the database includes only 6 urban areas for Oceania (Australia and proximate islands)54, the selection process yielded a total of 56 geographically, economically and ecologically heterogeneous cities (Supplementary Table 1).

The spatial extent of each city (the area containing all city residents) was defined as a contiguous area containing the city’s spatial coordinates22,53 and meeting or exceeding a given population density threshold (Supplementary Fig. 1). As cities in different parts of the world are characterized by a wide variety of population density levels and spatial attributes, each city’s density threshold was identified individually. Using global datasets of population distribution in 2000 (0.5 × 0.5 arcmin cell resolution, or approximately 1 × 1 km2 at the equator)55,56, contiguous areas were defined for a large range of population density threshold values (2–10,000 people per square kilometre). For each threshold value, the total population contained within the defined area was calculated and compared with the city’s population figure (as reported in the United Nations World Urbanization Prospects)22, and the threshold value producing the minimum difference in total population was selected. This procedure resulted in a range of density threshold values across the 56 cities (Supplementary Table 2), reflecting the fact that these cities are laid out in various ways, from those which are densely packed to those with considerable urban sprawl (Supplementary Fig. 3). Each city’s defined extent was also used to estimate city area and average population density (Supplementary Table 2).

Finally, the population distribution within each city’s extent was aggregated to match the cell resolution of crop nutrient requirements. Populations were multiplied by country-level per capita nutrient recovery potentials from human excreta in 2000 to arrive at a spatial distribution of human-derived nutrients recoverable from sanitation within the city (human excreta are estimated to be the largest nutrient source in urban sanitation13,33). Recovery potentials were estimated from information on per capita protein and caloric supply, nutrient excretion and recovery efficiencies (accounting for most nutrient losses in the recovery process) across various technology options (for example, solid precipitation, adsorption, ion exchange, ammonia stripping, direct reuse of source-separated urine and faeces) using procedures from previous work (Supplementary Methods 1 and Supplementary Table 3)16.

Nutrient distance analysis

Before conducting the nutrient distance analysis, datasets for each city were converted from the geographic coordinate system into a projected Universal Transverse Mercator (UTM) coordinate system locally appropriate to each city to enable more accurate distance calculations (Supplementary Table 2 shows selected UTM zones for each city). To correct for any discrepancies in total city population and any errors resulting from the altered cell sizes and orientations introduced when converting between coordinate systems, recoverable nutrient data were scaled to ensure the total nutrients in the city’s extent agreed with the population figure reported by the United Nations22.

We assumed nutrients recovered from a given city would not be allowed to cross national borders to reach cropland in a different country. Therefore, the agricultural nitrogen, phosphorus and potassium requirements data were clipped to include only the country where the city resides, after which these datasets were also projected into the appropriate UTM coordinate system.

As agricultural nutrients are required in various ratios depending on the crops being grown, and as ratios typically differ from those available in human excreta, three individual nutrient distance analyses (nitrogen, phosphorus and potassium) were conducted for each city. In each analysis, an iterative process allocated recoverable nutrients from the city to the closest cropland demanding those nutrients, ensuring that crop requirements were not exceeded (Supplementary Methods 2 and Supplementary Fig. 2). To begin each iteration, path distances were calculated from any cells with non-zero agricultural nutrient requirements to all other cells in the country. This operation accounted for changes in elevation using a global elevation raster (GTOPO30, 0.5 × 0.5 arcmin cell resolution, aggregated and projected into the local UTM coordinate system)57 and only considered overland travel (that is, travel could not occur directly through water bodies) using a global land area mask (0.5 × 0.5 arcmin cell resolution, aggregated and projected)58. Road networks were not considered, because spatial data on global road networks are of highly variable quality across countries containing the cities in our analysis (Supplementary Table 13). However, to investigate how road networks might affect our distance estimates, we conducted a quality control analysis for all 56 cities, choosing 5 cropland locations and comparing our distance estimates from the city centre with road distances obtained after inputting the coordinates into Google Maps. Each cropland location was randomly selected from a grid showing cells with potential nutrient application and containing no information on roads, and distances were measured to the centroid of the cell. On average, constraining transport to roadways was observed to affect distance measurements for a given city by 7–21% (Supplementary Methods 2 and Supplementary Tables 14 and 15). These differences will not change the broad trends observed in average distances, which span approximately 2 orders of magnitude across the 56 cities. In practice, locations and quality of transport infrastructure will play an important role in the feasibility of nutrient reuse, and should be considered when developing more precise estimates at the local level.

Following the path distance operation, we identified the city cell that was closest to a cell demanding nutrients, and a quantity of nutrients was transferred from the city cell to the cropland cell. If the cell’s total quantity of recoverable nutrients fell below what was required by the cropland, all nutrients were moved, whereas only enough nutrients to fully meet crop requirements were transferred if recoverable nutrients exceeded the demand. This procedure was repeated until all recoverable nutrients had been moved to cropland. The alternative condition, in which all cropland was saturated with nutrients (that is, the country’s nutrient demands were fully met before the city’s recoverable nutrients were exhausted), was also a possible scenario to complete the iterative process, but this condition was never satisfied.

To complete the analysis for one nutrient, results from all iterations were merged, defining the full agricultural area that could be fertilized by that nutrient through recovery from sanitation in a given city (Supplementary Fig. 3). These results indicated the nutrient quantities applied in each cell and the distances those quantities needed to travel. We calculated the city’s total nutrient mass, the distances required to utilize specified mass fractions of nutrients (5%, 25%, 50%, 75%, 95%) and a mass-weighted average distance of complete (100%) nutrient application. Each city’s total mass of recoverable nitrogen, phosphorus and potassium was also compared with annual fertilizer imports into the country from 2000 to 2010, to determine whether nutrient recovery from a nation’s largest cities could substantially reduce reliance on foreign fertilizer supplies. The procedure summarized above constituted the primary nutrient distance scenario (see Supplementary Methods 2 for further details), and the analysis was repeated under three altered scenarios (centralized, increased population/affluence and altered crops; described below and in Supplementary Table 5) to test the sensitivity of results and assess the potential impact of shifts in local crop types.

Sensitivity analyses

The preceding nutrient distance analysis was repeated twice to assess the sensitivity of the primary scenario’s results to changes in various conditions. In brief, the two sensitivity analyses included: (1) altered locations of recovered nutrients within cities to reflect high centralization of sanitation systems and (2) altered estimates to reflect potential increases in city population and food supply. These two scenarios are described in detail below.

The first alternative scenario (centralized) acknowledges that the nutrient distance analysis relies on a certain procedure for defining city extents (that is, a contiguous area meeting or exceeding a given population density threshold) and identifying where recoverable nutrients are located (based on population density within the city extents). However, urban extents are notoriously difficult to delineate, and a variety of definitions are in use that incorporate diverse factors (for example, population density, economic criteria, the presence of human-made structures)23,59,60. Additionally, the primary analysis assumes that nutrients from human waste can be recovered in the grid cell where they are generated. Stated differently, sanitation and nutrient recovery systems are assumed to be somewhat decentralized, with recovery occurring in each 10 × 10 km2 grid cell within the city. Depending on the city’s degree of urban sprawl, this assumption of decentralized systems could substantially impact nutrient distances. Therefore, the centralized scenario assumed that all recoverable nutrients from each city’s population were concentrated in a single location (that is, each city’s sanitation system was fully centralized, with all nutrient recovery occurring at one point). This location was assumed to be in the centre of the city (defined according to the city’s latitude and longitude as reported by the United Nations)22, which in most cases would place recovered nutrients at the largest possible distance from surrounding cropland. Repeating the analysis in this way characterizes the sensitivity of results to the definitions of urban extents and the degree of sanitation system centralization.

The second alternative scenario (increased population/affluence) considered the potential for rising city populations and food supplies. City populations from the year 2000 were used in the original analysis to correspond with harvested crop area datasets. However, populations of some cities have already shifted dramatically since 2000, and they are projected to continue changing in the future22. We characterized the increased population/affluence scenario using city population estimates for 203022, along with estimated per capita nutrient recovery potentials from human excreta in 2030 (to account for changes in nutrient excretion due to changing food supplies; Supplementary Methods 1)16. The new populations were distributed throughout each city’s urban extent by scaling up the density distributions from 2000. As this scenario is meant to assess sensitivity to increased supplies of recoverable nutrients (rather than provide a complete picture of future conditions), it neglects potential expansions in urban area, shifts in relative population density within a city’s extent and land use changes near the city. However, these additional changes may be substantial (and interrelated)40,61, and future context-specific studies geared toward individual city planning should account for their potential impacts.

Altered crop patterns

An additional scenario (altered crops) evaluated whether nutrients’ travel distances could be substantially reduced through changes in local crop patterns. For each country containing at least 1 of the 56 cities, nationally important crops (accounting for >10% of that country’s total harvested crop area) were considered as possibilities that could be grown around cities. The nationally important crops with the highest nitrogen, phosphorus and potassium requirements were independently identified, and existing crops were replaced wherever a grid cell’s nutrient demand was lower than it would be by growing the selected nationally important crop. This process occurred separately for each nutrient, so that optimal scenarios for nitrogen, phosphorus and potassium could each be considered. As such, this scenario provides relevant information regarding how crop type could support local nutrient recovery and reuse in agriculture.

Nutrient recovery products analysis

In addition to the distance nutrients must travel, the form in which they are recovered also plays a key role in developing efficient reuse systems. Depending on technology and process choice, nutrient recovery can generate numerous products of varying composition, ranging from dilute nutrients in treated wastewater to more nutrient-dense crystal products (for example, ammonium sulfate, ammonium struvite and potassium struvite, the last of which is functionally defined in wastewater treatment46)44,45,46,62,63. Each product’s nutrient concentration will determine the total mass that must be transported to deliver a given quantity of nutrients to cropland. While the same transport distance (average distance from the primary scenario) is used for each product in this exercise regardless of concentration, transport energy can be reduced substantially when nutrients are in more concentrated forms (for example, crystal products). Therefore, we identified multiple recovery products (treated wastewater without nutrient removal, dewatered sludge from anaerobic digestion, undiluted urine, crystal products (ammonium sulfate, ammonium struvite, potassium struvite)) to evaluate. Using reported compositions of each product (accounting for typical values and possible variations)34,43,46,63, we estimated the total mass needed to deliver 1 t of each nutrient (N, P, K). The products’ mass factors (mass of product per mass of nutrient) were multiplied by representative distances for each city (that city’s average nutrient distances from the primary scenario) and energy factors (required transport energy per mass and distance transported) to estimate the energy required to transport 1 t of each nutrient to cropland. Transport energy calculations assumed that reclaimed wastewater was pumped to cropland (pumping energy estimated using equations and assumptions from Shoener et al.64), while other products travelled by truck (road freight vehicle energy estimated using the ecoinvent 2.2 database). In addition to variations in product composition, reported energy ranges also reflect a wide spectrum of energy values from different pumping velocities and freight vehicles (all parameter ranges provided in Supplementary Table 12).

These results were compared with estimates of the energy required for synthetic fertilizer production and transport (Fig. 3), calculated using literature data65 and the ecoinvent 2.2 database, accounting for production of various single-nutrient fertilizers (urea, ammonium nitrate, ammonium sulfate, triple superphosphate, single superphosphate, potassium chloride, potassium sulfate). The comparison provides an assessment of whether transport of recovered nutrients using a certain product in a given city may require less energy than synthetic fertilizer production and distribution.

Statistical analyses

After completing the nutrient distance analysis, mass-weighted average distances and the distances required to utilize specified mass fractions of each recoverable nutrient were compared with various city characteristics to identify trends and correlations. Spearman’s rank-order correlation coefficients and P values (two-tailed)66 were calculated for each pairing of nutrient distances and quantitative city characteristics (including: average cropland density within 10, 50 and 100 km of city boundaries67; total city population22; city area and average population density (calculated using the defined city extents); total recoverable nutrients (calculated from city population22 and per capita nutrient recovery potentials16); country per capita GDP in 200068). We also performed simple linear regressions to provide a rough indication of the magnitude of a given factor’s effects, complementing the Spearman’s correlation analysis. Kruskal–Wallis tests (one-way analysis of variance on ranks, a non-parametric method for data that are not normally distributed)69 were performed for each combination of nutrient distances and categorical city characteristics (including: continent; whether the city is located near a coast (within 100 km36 of an ocean or major freshwater body)). We also computed simple averages and standard deviations for selected categorical groupings to complement the Kruskal–Wallis tests. All statistical calculations were performed in Matlab R2015a.

Data availability

All data supporting the findings of this study are available in the Supplementary Information or from the corresponding author upon request.