Considering the implementation of the Social Insurance Law (SIL) as a quasi-natural experiment, we investigate the impact of labor protection on the digital transformation of enterprises. Our findings demonstrate that the SIL markedly expedites the digital transformation of enterprises. Mechanism analysis indicates that the SIL drives enterprises to shift their employment structure and provides important human capital conditions for digital transformation. The implementation of the law also helps to enhance the growth of enterprises, accelerating their digital transformation. Furthermore, non-state-owned and highly financing-constrained enterprises are more likely to respond to the reinforcement of labor protection by means of digital transformation.