This article analyzes profit taxation according to the arm's length principle in a 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. Moreover, market input prices include a mark-up that arises from the bargaining between the firm and the independent supplier. Transfer prices set at market values following the arm's length principle thus systematically exceed multinationals' marginal costs, leading to a reduction of tax payments for each unit sold. The optimal organization of firms hence provides a new rationale for the empirically observed lower tax burden of multinational corporations.