This paper quantifies the origins of firm size heterogeneity when firms are interconnected in a production network. We document new stylized facts about the universe of buyer-supplier relationships among all firms in Belgium during 2002-2014. These facts motivate a model in which firms buy inputs from upstream suppliers and sell to downstream buyers and final demand. Firms can be large not only because they have high production capability (i.e. productivity or product quality), but also because they interact with more, better and larger buyers and suppliers, and because they are better matched to their buyers and suppliers. The model delivers an exact decomposition of firm size into upstream and downstream margins with firm, buyer/supplier and match components. We establish three empirical results. First, downstream factors explain the vast majority of firm size heterogeneity, while upstream factors are only one fourth as important. Second, nearly all the variation on the downstream side is driven by network sales to other firms rather than final demand. By contrast, most of the variation on the upstream side reflects own production capability rather than network purchases from input suppliers. Third, most of the variance in network sales is determined by the number of buyers and the allocation of sales towards well-matched buyers of high quality, rather than by average buyer capability. By contrast, most of the variance in network purchases comes from average supplier capability and the allocation of purchases towards well-matched suppliers of high quality, rather than from the number of suppliers. Joint with Andrew B. Bernard, Emmanuel Dhyne, Kalina Manova and Andreas Moxnes.