We develop a theory of cross-border income shifting in response to subnational personal taxation in a federation and examine its implications for the excess burden of personal taxes. We show how a properly-chosen federal tax rate can offset the fiscal externality between states and facilitate decentralization, even in a heterogeneous federation where unitary taxation is suboptimal. Optimal taxes depend on the elasticities of national tax avoidance and of cross-state tax base shifting. We estimate these elasticities around a tax decentralization reform in Canada, finding both to be empirically relevant. We discuss the implications for optimal federalism.