Heart failure (HF) is greatly threatening human health and affecting morbidity and mortality worldwide. Troxerutin can alleviate myocardial injury induced by ischemia and hypoxia. The present study aimed to investigate the protective effect of troxerutin on H2O2‐induced cardiomyocytes and the underlying molecular mechanism. Primary mouse cardiomyocytes morphology induced by H2O2 in a different duration time was observed by a microscope. After indicated treatment, the viability and apoptosis of cardiomyocytes were detected by CCK‐8 assay and flow cytometry analysis. The expression of inflammatory factors and oxidative stress biomarkers was detected by Reverse transcription‐quantitative polymerase chain reaction (RT‐qPCR) and assay kits. Hypoxia inducible factor‐1a (HIF‐1α) expression was determined by western blot analysis, RT‐qPCR analysis and immunofluorescence staining. The apoptosis‐related protein expression and the phosphorylation level of janus‐activated kinase 2 (JAK2)/signal transducer and activator of transcription 3 (STAT3) were detected by the western blot analysis. As a result, after the H2O2 treatment in a different duration time, the primary mouse cardiomyocytes gradually stopped beating and the morphology of cardiomyocytes treated with H2O2 was changed significantly from fusiform shape to round shape. The viability of cardiomyocytes was decreased after H2O2 induction. The HIF‐1α expression was increased after the H2O2 treatment within 30 min while decreased over 30 min. In addition, troxerutin improved viability and suppressed apoptosis, inflammation and oxidative stress of H2O2‐induced cardiomyocytes, which was reversed by KC7F2 (a HIF‐1α inhibitor) or CHZ868 (a JAK inhibitor). To sum up, troxerutin could regulate HIF‐1α by activating JAK2/STAT3 signaling to inhibit oxidative stress, inflammation, and apoptosis of cardiomyocytes induced by H2O2.