This study examines the effect of environmental, social, and governance factors, earning management, and company size as moderating variables. Tax avoidance (TA) is an action taken by taxpayers to legally avoid taxes that does not violate tax regulations. Taxpayers use TA to reduce their tax liability by taking advantage of loopholes in the tax code. For example, reporting net income is smaller than it actually is. This study investigates the factors that influence tax avoidance. The factors are environmental, social, and governance (ESG) and earnings management (EM), with company size (CS) as a moderating variable. This study employed a quantitative methodology and used secondary data as the data type. The population of study is LQ45 Company for the years 2017-2021. The samples are selected based on some criteria. Based on those criteria, thirty companies were selected for the sample. Multiple linear analysis methods and moderate regression analysis are used in hypothesis testing. The statistical testing of the study found that EM had no impact on TA, while ESG had a considerable beneficial impact on TA. The impact of EM on TA can be both moderated and strengthened by CS, whereas the impact of ESG on TA cannot be. The management decisions made by the business are connected to the ESG activities the business is engaged in. The company's ESG efforts need to be carefully monitored to prevent increased TA tactics.