This study aims to determine the effect of green accounting on firm profitability, with firm size, leverage, and liquidity as moderating variables. This research employs a quantitative approach using secondary data analysis derived from annual reports and sustainability reports of energy firms listed on the Indonesia Stock Exchange (IDX) during the 2021–2024 period. The study applies multiple regression analysis. The sampling method used is non-probability sampling with a purposive sampling technique, resulting in 170 observations. The data collection method uses documentation techniques. The results show that green accounting and firm size have a positive effect on profitability, while leverage and liquidity have no effect on profitability. These findings provide important insights into the role of green accounting and firm size in encouraging firms to obtain legitimacy, which can enhance profitability through disclosures in financial reports. The implications of this study demonstrate the application of legitimacy theory and provide benefits to relevant parties, particularly firms and stakeholders associated with the firm, in paying attention to the presentation of high-quality annual and sustainability reports.