In view of the influence of different factors on the leakage and diffusion of hydrogen?doped natural gas pipelines in the pipe gallery, the leakage and diffusion model of hydrogen?doped natural gas pipelines in the pipe gallery was established by numerical simulation software, and the influence of factors such as hydrogen doping ratio, pipeline pressure,leakage hole size and the model of ventilation on the gas diffusion process was studied. The results show that the hydrogen blending ratio can affect the mass transfer ability of hydrogen?doped natural gas, and the higher the hydrogen blending ratio, the faster the diffusion rate of hydrogen?doped natural gas. The pipeline pressure and leakage hole size mainly affect the leakage gas diffusion by affecting the initial kinetic energy and leakage volume of the leakage gas, and the leakage gas diffusion range becomes larger with the increase of pipeline pressure and leakage hole size. The ventilation mode plays a dominant role in the distribution of leaked gas in the pipe gallery, and the ventilation frequency is inversely proportional to the height of the leaked gas jet.