This study examines the relationship between macroeconomic uncertainty and earnings management, using quarterly data of US commodity firms from the period 1990–2019. The findings show that oil and iron firms use both accruals and real activities to decrease earnings in quarters with high basis risk. Earnings management is economically significant. Further investigation provides fine-grained evidence that specific types of uncertainty (economic policy, climate policy, geopolitical) have varying effects on earnings management. The study also provides evidence that earnings management is aimed at giving investors useful information about the firms’ performance during uncertain times. The study contributes to previous research on uncertainty and earnings management. It also informs market participants about the financial reporting quality of commodity firms, and has practical implications for financial reporting regulation in extracting industries.