Background In the United States, both cannabis use disorder (CUD) and opioid use disorder (OUD) have increased in prevalence. The prevalence, demographics, and costs of CUD and OUD are not well known in heart failure (HF) admissions. This study aimed to use a national database to examine the prevalence, demographics, and costs associated with CUD and OUD in HF. Methods This study used the National Inpatient Sample from 2008 to 2018 to identify all primary HF admissions with and without the co-diagnosis of OUD or CUD using International Classification for Diagnosis, diagnosis codes. Demographics, costs, and trends were examined. Results Between 2008 and 2018, we identified 11,692,995 admissions for HF of which 84,796 (0.8%) had a co-diagnosis of CUD only, and 67,137 (0.6%) had a co-diagnosis of OUD only. The proportion of HF admissions with CUD significantly increased from 0.3% in 2008 to 1.3% in 2018 (p Conclusions Among discharge records for HF, CUD and OUD are increasing in prevalence, significantly affect underserved populations and are associated with higher costs of stay. Future research is essential to better delineate the cause of these increased costs and create interventions, particularly in underserved populations.