We derive an optimal labor income tax rate formula for urban models that nests the Mirrlees model as a limiting case. Optimal tax rates are determined by traditional forces plus a new term arising from urban forces: house price, migration and agglomeration effects. Based on the earnings distribution, housing costs and housing tenure in large and small US cities, we find that in a benchmark model (i) the optimal income tax rate schedule is U-shaped, (ii) urban forces raise the optimal tax rate schedule at all income levels and (iii) adopting an optimal tax system induces agents with low skill levels to leave large, productive cities.