In most countries, average wages tend to be higher in larger cities. In this paper, we focus on the role played by the matching of workers to firms in explaining geographical wage differences. Using rich administrative German data for 1985-2014, we show that wages in large cities are higher not only because large cities attract more high-quality workers, but also because high-quality workers are significantly more likely to be matched to highquality plants. In particular, we find that assortative matching - measured by the correlation of worker fixed effects and plant fixed effects - is significantly stronger in large cities. The elasticity of assortative matching with respect to population has increased by around 75% in the last 30 years. We estimate that in a hypothetical scenario in which we keep the quality and location of German workers and plants unchanged, and equalize within-city assortative matching geographical wage inequality in Germany would decrease significantly. Overall, assortative matching magnifies wage differences caused by worker sorting and is a key factor in explaining the growth of wage disparities between communities over the last three decades. If high-quality workers and firms are complements in production, moreover, increased assortative matching will increase aggregate earnings. We estimate that the increase in within-city assortative matching observed between 1985 and 2014 increased aggregate labor earnings in Germany by 2.1%, or 31.32 billion euros. We conclude that assortative matching increases earnings inequality across communities, but it also generates important efficiency gains for the German economy as a whole.