This paper examines the impact of implementing a carbon tax on aggregate total factor productivity in the Dominican Republic through the resource allocation channel. It incorporates energy inputs―electricity and fuel―into firms’ production functions, allowing predictions of potential changes in resource allocation due to the carbon tax. The theoretical implications of the model indicate that the carbon tax has a heterogeneous effect on firms’ input choices, contingent on the level of firms’ existing input market distortions. Moreover, the model suggests that in economies in which more productive firms are less distorted, the carbon tax can decrease aggregate total factor productivity. In contrast, when more productive firms are more distorted, the carbon tax can increase or decrease aggregate total factor productivity. Utilizing detailed firm-level data from 2009 to 2018, covering up to 118,000 firms, this paper finds that a carbon tax is more effective when levied on fuels rather than electricity. For the majority of sectors in the sample, the paper finds that existing distortions in energy consumption are positively correlated with firm-level productivity. Moreover, the quantitative results show that the introduction of the carbon tax shifts the burden of market distortions from high productivity firms to low productivity ones, generating aggregate total factor productivity gains for most sectors in the Dominican Republic. Overall, this study underscores the importance of considering existing input market distortions when analyzing the impact of environmental taxes.