Abstract This paper takes listed companies in heavily polluting industries from 2016 to 2021 as the research object, divides the sources of funds into debt financing and equity financing and measures the green transformation of enterprises using green innovation capability and green governance performance, respectively. It studies the heterogeneous impact of financing sources on the green transformation of enterprises.The are following findings: (1) Debt financing can promote the green transformation of enterprises because the binding nature of debt can inhibit inefficient investment and on-the-job consumption of enterprises and thereby promote the green transformation of enterprises; (2) At present, the reason why equity financing does not promote the green transformation of enterprises is that the equity financing for green transformation projects will disperse the control rights of the original shareholders, exacerbate the agency problem between management and owners and restrict the advantages of equity financing; (3) Agency costs play an intermediary role in the impact of different financing sources on the green transformation of enterprises. That is, debt financing promotes enterprises to achieve green transformation faster by reducing principal-agent costs, and equity financing is not conducive to the green transformation of enterprises by increasing agency costs. The conclusion provides a valuable supplement to the economic consequences of financing sources and the influencing factors of green transformation, offering insights for the practice of corporate green sustainable development and the selection of funding sources.