Heart failure (HF) is a complex trait, influenced by environmental and genetic factors, which affects over 30 million individuals worldwide. Historically, the genetics of HF have been studied in Mendelian forms of disease, where rare genetic variants have been linked to familial cardiomyopathies. More recently, genome-wide association studies (GWAS) have successfully identified common genetic variants associated with risk of HF. However, the relative importance of genetic variants across the allele-frequency spectrum remains incompletely characterized. Here, we report the results of common- and rare-variant association studies of all-cause heart failure, applying recently developed methods to quantify the heritability of HF attributable to different classes of genetic variation. We combine GWAS data across multiple populations including 207,346 individuals with HF and 2,151,210 without, identifying 176 risk loci at genome-wide significance (P-value < 5×10 -8 ). Signals at newly identified common-variant loci include coding variants in Mendelian cardiomyopathy genes ( MYBPC3 , BAG3 ) and in regulators of lipoprotein ( LPL ) and glucose metabolism ( GIPR , GLP1R ). These signals are enriched in myocyte and adipocyte cell types and can be clustered into 5 broad modules based on pleiotropic associations with anthropomorphic traits/obesity, blood pressure/renal function, atherosclerosis/lipids, immune activity, and arrhythmias. Gene burden studies across three biobanks (PMBB, UKB, AOU), including 27,208 individuals with HF and 349,126 without, uncover exome-wide significant (P-value < 1.57×10 -6 ) associations for HF and rare predicted loss-of-function (pLoF) variants in TTN , MYBPC3 , FLNC, and BAG3. Total burden heritability of rare coding variants (2.2%, 95% CI 0.99-3.5%) is highly concentrated in a small set of Mendelian cardiomyopathy genes, while common variant heritability (4.3%, 95% CI 3.9-4.7%) is more diffusely spread throughout the genome. Finally, we show that common-variant background, in the form of a polygenic risk score (PRS), significantly modifies the risk of HF among carriers of pathogenic truncating variants in the Mendelian cardiomyopathy gene TTN. Together, these findings provide a genetic link between dysregulated metabolism and HF, and suggest a significant polygenic component to HF exists that is not captured by current clinical genetic testing.