This study investigates how the layout of urban spaces affects the gender pay gap in China and the underlying mechanisms. Using detailed residential address information, our findings suggest that the non-compact urban geometry widens the gender pay gap. We find that irregular urban form increases commuting costs, weakens transport connectivity, and slows the growth of female-intensive industries, jointly amplifying gender disparities, thereby contributing to the enlarged gender pay gap. Our analysis also reveals notable heterogeneity in the impact of urban shape on workers’ salaries, stratified by type of hukou, migration status, marital status, educational level, and residential location.