ABSTRACT In terms of trade determinants, digital trade exhibits distinct disparities compared to traditional trade. This paper investigates the role of the digital legal framework as a new source of comparative advantage in digital trade development. Utilising cross‐border digital trade data covering 107 exporting countries or regions, 127 importing partners, and 8 industries in 2019, we empirically analyse the impact effect and underlying mechanisms of the digital legal framework on cross‐border digital trade. The findings reveal that the digital legal framework significantly enhances a country's comparative advantage in digital trade, thereby fostering cross‐border digital trade exports. Furthermore, we find that the digital legal framework facilitates digital trade by influencing institutional distance and lowering trade costs. Additionally, its effects are more pronounced in developing countries, as well as in economies with stronger contract enforcement and stricter regulatory environments. This study provides new evidence on the determinants of digital trade from dual perspectives of the source of comparative advantage and institutional drivers, offering valuable insights for enhancing the digital legal framework and developing strategies to promote digital trade.