Abstract Background and aims Understanding the relationship between heat and drug overdose mortality is critical given the ongoing overdose crisis and rising global temperatures driven by climate change. Evidence from local jurisdictions in the United States (US) and Canada indicates that exposure to heat is associated with increased drug overdose fatalities, but the widespread impact of heat on national drug overdose deaths is undetermined. We aimed to determine the effect of heat exposure on drug overdose mortality in the US. Design An observational study using monthly, county‐level data from 1999 to 2020 and a fixed effect model estimated with linear regression. The model accounts for time‐invariant county‐month factors and state‐level time‐specific shocks. Setting All counties in the continental US during the months of June to September from 1999 to 2020. Participants Decedents in the National Center for Health Statistics restricted Vital Statistics mortality data with a cause of death of a drug overdose, aggregated to county‐level mortality rates. Measurements All drug overdose mortality rate per 100 000 population. The monthly average maximum heat index (measured in degrees Celsius) was collected from the Centers for Disease Control and Prevention National Environmental Public Health Tracking Network. Findings A one‐degree Celsius increase in the heat index was associated with an increase in all drug overdose mortality by 0.0098 deaths per 100 000 population [95% confidence interval (CI) = 0.0057–0.014, P < 0.001], with significant effects for deaths related to opioids (0.0060 deaths, 95% CI = 0.0026–0.0095, P < 0.001), cocaine (0.0028 deaths, 95% CI = 0.0012–0.0045, P < 0.001) and psychostimulants (0.0028 deaths, 95% CI = 0.0015–0.0041, P < 0.001). In further analyses, larger impacts were observed after 2013, in counties with greater levels of social vulnerability and in suburban and urban counties. Estimates suggest that approximately 150 excess drug overdose deaths occurred per year during the hottest periods due to heat exposure. Conclusions Exposure to heat appears to be associated with increases in drug overdose deaths in the United States in recent decades.