We estimate a structural model of heterogeneous multiproduct firms to examine the sources of firm heterogeneity emphasized in the recent trade and macro literatures. Using Nielsen barcode data on prices and sales, we estimate elasticities of substitution within and between firms, and use the estimated model to recover unobserved qualities, marginal costs and markups. We find that variation in firm quality and product scope explains at least four fifths of the variation in firm sales. Most firms are well approximated by the monopolistic competition benchmark of constant markups, but the largest firms that account for most of aggregate sales depart substantially from this benchmark. Although the output of multiproduct firms is differentiated,...