ABSTRACT Digital transformation presents both opportunities and challenges for companies. However, there is little literature that investigates external factors affecting corporate digital transformation. This paper explores the impact of bankruptcy law enforcement on corporate digital transformation, using the introduction of bankruptcy courts in China as a quasi-natural experiment. Using the 2010–2019 data of Chinese A-share listed companies, we find that bankruptcy courts significantly increase digital transformation by 17.5%. The effects are driven by increased debt financing and reallocation of digital talent, and are more pronounced for firms reliant on external financing and in cities with more zombie firms. Our study highlights the importance of legal institutions in supporting digital initiatives and offers insights for policymakers and managers to drive digitalization. Future research could expand to SMEs and other influencing factors.