This study uses empirical methods to explore the relationship between subway system development and air quality in the Yangtze River Delta. We propose a new variable to measure subway development, "subway station density value," which can more accurately describe subway development than the traditional "line opening" variable. It eliminates the effects of differences in subway line length, layout, and size of the local subway system. Using this variable, we find that subway development has a significant positive impact on air quality improvement; that is, an increase in the density of subway stations is significantly associated with improved air quality. This finding provides a scientific basis for the relevant authorities to formulate the development and layout of public transport facilities. It strongly responds to previous debates on the relationship between subways and air quality. In addition, we find that urban population size, economic development level, and subway system size play moderating roles in the relationship between subways and air quality. Increasing the availability of subways can significantly improve the air quality in cities with high population sizes and economic development levels. However, as the size of a subway system increases, its effect on air quality improvement may weaken, suggesting that the development of subway systems should not be unthinkingly expanded either. Although our study has valuable findings, we must discuss several limitations further. These include restrictions in the selection of the study population, data availability, and potentially oversimplified criteria for considering the impact of urban differences. Overall, this study not only provides new theoretical and empirical perspectives for understanding and explaining how subway development affects air quality but also indicates the direction for further exploration in future studies.