Urban agriculture (UA) is a widely proposed strategy to make cities and urban food systems more sustainable. Until now, we have lacked a comprehensive assessment of the environmental performance of UA relative to conventional agriculture, and results from earlier studies have been mixed. This is the first large-scale study to resolve this uncertainty across cities and types of UA, employing citizen science at 73 UA sites in Europe and the United States to compare UA products to food from conventional farms. Results reveal that the carbon footprint of food from UA is six times greater than conventional agriculture (420 gCO2e versus 70 gCO2e per serving). However, some UA crops (for example, tomatoes) and sites (for example, 25% of individually managed gardens) outperform conventional agriculture. These exceptions suggest that UA practitioners can reduce their climate impacts by cultivating crops that are typically greenhouse-grown or air-freighted, maintaining UA sites for many years, and leveraging circularity (waste as inputs).