PurposeThis study aims to examine the impact of economic policy uncertainty (EPU) on firm investment in corporate social responsibility (CSR)’s environmental, social and governance (ESG) dimensions. Additionally, the study examines whether firm size moderates the EPU–CSR relationship.Design/methodology/approachThe sample includes 2,017 US. firms from 2002 to 2018. Data on ESG scores are drawn from the Asset-4 database in Thomson Reuters to measure CSR investment. ordinary least square regression, including fixed effects at the year and industry level, is used as the main econometric specification. Moreover, the study employed the two-step system Generalized Method of Moments to address the endogeneity concerns.FindingsThe findings reveal that firms increase their CSR investment in response to high EPU. The results are consistent in all the three ESG/CSR dimensions: ESG. Moreover, the positive association between EPU and CSR is driven by firm size, indicating that large-sized firms have the resources and incentives to invest more in CSR. Our main findings remain consistent after addressing the endogeneity concerns and controlling for the effect of omitted variable biasness.Originality/valueUsing a unique sample of US firms, this study empirically contributes to the current literature on the association between EPU and CSR investment. Moreover, firm size plays a vital role in moderating this relationship.