Hydrogen energy is favored as an ideal clean energy source, and doping hydrogen into natural gas pipelines is an effective way to realize large-scale delivery of hydrogen energy. Once pipelines leaking during transportation, the safe operation of pipelines will be seriously affected. At present, the leakage and diffusion law of hydrogen-doped natural gas buried pipelines in tunnels is not clear. A numerical model of leakage and diffusion for hydrogen-doped natural gas buried pipelines in tunnels was established to study the effects on hydrogen doping ratio (volume fraction), leakage aperture and incoming wind speed of leakage and diffusion characteristics of the gas mixture. The results show that hydrogen-doped natural gas accumulates at the top of tunnel after leaking, showing the phenomenon of high concentration in the center area and low concentration in the edge area. With the increase of hydrogen doping ratio, the lower explosion limit of the gas mixture decreases, and the leakage volume increases. Due to the confined space of tunnel, the gas mixture can not be fully diffused in a short period of time, so the larger the hydrogen doping ratio, the larger the explosion area, and the shorter the time to reach explosion limit. When hydrogen doping ratio increases from 5% to 20%, the explosion danger area increases by 3.18%, the gas to reach explosion limit time decreases by 3.7%. As the leakage aperture increases, the leakage amount of the mixed gas increases, the explosion danger area increases, and the time for the mixed gas to reach the explosion limit decreases. When leakage aperture increases from 20 mm to 100 mm, the distance from ground to the explosion danger area in the radial direction of tunnel decreases from 1.49 m to 0.30 m, the axial explosion danger area increases from 13.4 m to 91.9 m, and the time for gas to reach explosion limit decreases from 95.2 s to 11.3 s. The advection transport effect of incoming wind speed promotes the diffusion of mixed gas along axial direction of tunnel, reduces the high concentration area at the top of tunnel, and makes the explosion danger area significantly smaller. When incoming wind speed increases from 0.5 m/s to 2.0 m/s, the explosion danger area decreases by 81.7%. Therefore, tunnels should be ventilated in time when gas leakage occurs to avoid the occurrence of combustion and explosion. The results of this study can provide a theoretical basis for the safe operation of hydrogen-doped natural gas buried pipelines. [ABSTRACT FROM AUTHOR]