Background: Lifestyle factors may be important targets in the prevention of heart failure. The current knowledge on the relationship between lifestyle factors and heart failure originates mostly from observational studies. The objective of this study was to investigate causal associations of multiple lifestyle factors with heart failure risk by using Mendelian randomization. Methods: We obtained summary statistics data for single nucleotide polymorphisms associated with the following 5 lifestyle factors at genome-wide significance in genome-wide association studies of European-descent individuals: smoking, alcohol consumption, coffee consumption, physical activity, and sleep duration. The corresponding data for heart failure were acquired from a genome-wide association study comprising 47,309 cases and 930,014 controls of European ancestry. For the primary analyses, we used the inverse-variance weighted method. Results: Genetic predisposition to smoking initiation (ever smoked regularly) was robustly associated with a higher odds of heart failure (odds ratio: 1.28; 99% CI: 1.21-1.35). Genetically predicted longer sleep duration was associated with a lower odds of heart failure (odds ratio per hour/day: 0.73; 99% CI: 0.60-0.89). We found no associations of alcohol consumption, coffee consumption, and physical activity with heart failure. Conclusions: This Mendelian randomization study showed that smoking initiation increases heart failure risk, whereas longer sleep duration decreases the risk of heart failure. Sleep duration should be regarded as novel risk factor in heart failure prevention guidelines. The potential causal role of alcohol and coffee consumption and physical activity for heart failure warrants further investigation in future larger Mendelian randomization analyses.