This article analyzes profit taxation according to the arm's length principle in a new model where heterogeneous firms sort into foreign outsourcing. We show that multinational firms are able to shift profits abroad even if they fully comply with the tax code. This is because, in equilibrium, intra-firm transactions occur in firms that are better than the market at input production. Transfer prices set at market values following the arm's length principle thus systematically exceed multinationals' marginal costs. This allows for a reduction of tax payments with each unit sold. The optimal organization of firms hence provides a new rationale for the empirically observed lower tax burden of multinational corporations