Background: Ferroptosis is a new form of cell death recently discovered that is distinct from apoptosis, necrosis and autophagy. This article is expected to provide a new direction for the treatment of cardiomyopathy in the future by screening potential drug targets associated with ferroptosis.Methods: Differential expression analysis of GSE5406 from the Gene Expression Omnibus (GEO) database was performed using the GEO2R tool. Functional annotation of ferroptosis related genes was also performed. Then we constructed protein-protein interaction networks and identified hub genes using Cytoscape. The candidates for pharmacological compounds targeting the hub genes were screened by cMap.Results: Totally 15 ferroptosis related genes (4 upregulated and 11 downregulated) for ischemic cardiomyopathy and 17 ferroptosis related genes (13 upregulated and 4 downregulated) for idiopathic cardiomyopathy were found. The biological processes involved in these genes mainly include negative regulation of apoptotic process, flavonoid metabolic process, response to drug for ischemic cardiomyopathy and cellular response to fibroblast growth factor stimulus, negative regulation of apoptotic process, and response to drug for idiopathic cardiomyopathy. KEGG results showed that these genes were mainly involved in MAPK signaling pathway for ischemic cardiomyopathy and PI3K-Akt signaling pathway for idiopathic cardiomyopathy. We generated a co-expression network for hub genes and obtained top 10 medications suggested respectively for ischemic/idiopathic cardiomyopathy.Conclusion: Our study reveals the potential role of ferroptosis related genes in ischemic and idiopathic cardiomyopathy through bioinformatics analysis. The hub genes and potential drugs may become novel biomarkers for prognosis and precision treatment in the future.