The increasing use of transfer pricing by multinational corporations has raised concerns regarding aggressive tax avoidance practices, particularly in emerging markets such as Indonesia. This study examines the effect of transfer pricing on tax avoidance and investigates the moderating role of Environmental, Social, and Governance (ESG) performance in this relationship. Using a quantitative explanatory approach, this research analyzes panel data from non-financial companies listed on the Indonesia Stock Exchange during 2021–2023. Tax avoidance is proxied by the Cash Effective Tax Rate (CETR), transfer pricing is measured by the ratio of related-party transactions to total revenue, and ESG performance is assessed using Thomson Reuters ESG scores. Moderated Regression Analysis (MRA) is employed to test the hypotheses. The novelty of this study lies in positioning ESG performance as a moderating variable in the transfer pricing–tax avoidance relationship within an emerging market context, integrating Stakeholder Theory and Tax Planning Theory to explain ESG’s dual role as a self-regulatory mechanism and a potential legitimacy tool. The results show that transfer pricing negatively affects CETR, indicating higher levels of tax avoidance. However, ESG performance does not significantly moderate the relationship between transfer pricing and tax avoidance, suggesting that ESG disclosure has not effectively constrained aggressive tax strategies. This study concludes that while transfer pricing contributes to tax avoidance, ESG performance has yet to function as an effective governance mechanism in Indonesia. Future research should explore specific ESG dimensions, corporate governance quality, and cross-country comparisons.