Inefficient allocation of inputs across firms has gained a prominent role in explaining development outcomes. Yet, inferring the costs of misallocation is challenging. Ignored firm heterogeneity from technology and demand biases the inferred costs from misallocation upwards or downwards. This paper develops and estimates a structural model that disentangles fundamental heterogeneity on the demand side from input misallocation distortions. Counterfactual analysis is performed by comparing equilibria in an oligopolistic setting with differentiated products. This enables comparative statics for a rich set of outcomes at any level of aggregation, as well as estimating their uncertainty. Instead of the usual TFP “accounting” approach that relies on aggregate production functions, exact consumer and producer welfare measures are used and aggregate inputs allowed to adjust. Using plant quantity and price data from the Indian iron and steel industry, I find no losses in aggregate labour or aggregate material productivity from misallocation as both total output and total input use are affected. Welfare losses, however, are large, equivalent to 31% of sales and higher for consumers than producers, driven by higher prices. Perhaps surprisingly, welfare losses due to misallocation in material input markets are 90% larger than those from misallocation of labour. Geographical access to the relevant input suppliers through the transportation network is found to be a significant driver of material misallocation. A one standard deviation increase in access to suppliers reduces the material distortion by a third of its standard deviation. This suggests allocative benefits of infrastructure investment beyond reducing direct shipping costs.