Prior studies ignore the impact of infrastructure on university technology transfer. High-speed rail, China’s most significant infrastructure, has played an essential role in the economy and society. Using high-speed railway construction as a quasi-experiment and a large sample of Chinese universities for the 2007–2017 period, we investigate the impact of high-speed rail on university technology transfer. We provide extensive evidence that high-speed rail has a positive effect on university technology transfer. The finding remains valid after a battery of robustness tests. Mechanism tests find that high-speed rail can improve university technology transfer by promoting the interaction between universities and enterprises and improving enterprises’ technology demand for universities. Further analysis shows that better intellectual property protection strengthens the effect of high-speed rail on university technology transfer, and the relationship between high-speed rail and university technology transfer is more prominent in the regions with underdevelopment technology trading markets. Our study suggests that high-speed rail is an important variable that affects university technology transfer.