Interleukin (IL)-12p40 is a common subunit of the bioactive cytokines IL-12 and IL-23, and it also has its own intrinsic functional activity. However, its role in doxorubicin-induced chronic cardiomyopathy (DICCM) as well as the underlying mechanisms are still unknown. In this study, we used IL-12p40-knockout mice, IL-23p19-knockout mice, Rag1-knockout mice, a ferroptosis inhibitor, recombinant IL-12 (rIL-12), rIL-23, rIL-12p40, rIL-12p80, and anti-IL17A to investigate the effects of IL-12p40 on DICCM and elucidate the underlying mechanisms. We found that myocardial ferroptosis were increased in DICCM and that the inhibition of ferroptosis protected against DICCM. The expression of IL-12p40 was upregulated, and IL-12p40 was predominantly expressed by CD4+ T cells in the hearts of mice with DICCM. IL-12p40 knockout attenuated cardiac dysfunction, fibrosis and ferroptosis in DICCM, and similar results were observed in the context of CD4+ T cell IL-12p40 deficiency in Rag1-/- mice. Treatment with rIL-23, but not rIL-12, rIL-12p40 monomer or rIL-12p80, abolished the protective effects of IL-12p40 knockout. Moreover, rIL-23 treatment and IL-23p19 knockout exacerbated and ameliorated DICCM, respectively. IL-12p40 knockout might protect against DICCM by inhibiting Th17 differentiation and IL-17A production but not Th1, Th2 and Treg differentiation. Neutralizing IL-17A with an antibody also attenuated cardiac dysfunction, fibrosis and ferroptosis. The IL-12p40/Th17/IL-17A axis might promote cardiomyocyte ferroptosis by activating TNF receptor-associated factor 6 (TRAF6)/mitogen-activated protein kinase (MAPK)/P53 signaling in DICCM. Interleukin-12p40 deficiency protects against DICCM by inhibiting Th17 differentiation and the production of IL-17A, which plays critical roles in cardiomyocyte ferroptosis in DICCM via activating TRAF6/MAPK/P53 signaling. Our study may provide novel insights for the identification of therapeutic targets for treating DICCM in the clinic.