PurposeThis study aimed to investigate the role of the country's institutional quality on the environmental, social and governance (ESG) performance of its companies.Design/methodology/approachOver a four-year period (2016–2019), the study examined the ESG performance of 412 organizations situated in 19 countries. ESG performance was the dependent variable, and the independent variables were rule of law, economic freedom, education index and international trade freedom. These factors described the institutional quality of countries in the authors’ study.FindingsThe findings reveal that institutional quality has a major impact on ESG performance. Companies engage in more ESG practices when they operate in countries with greater economic freedom and international trade freedom. The authors corroborated the core assumption of institutional theory (IT), which argues that organizational behavior is determined by the country's institutional setting.Research limitations/implicationsThe findings, like all research, should be interpreted with caution. The authors’ research focused solely on large energy corporations. As a result, the conclusions cannot be applied to small companies or other industries. ESG performance can also be measured using different datasets.Practical implicationsIf managers want their companies to perform better in terms of ESG, the authors recommend that they form a CSR committee and sign the Global Compact. This study may be valuable to international policymakers because they can underline that greater economic freedom, better education and greater international trade freedom all promote higher ESG performance.Originality/valueTo the best of the authors' knowledge, nearly all of research explores the relationship between ESG and financial performance. As a result, this study built on past research by investigating how national aspects affect corporate ESG performance.