In order to further investigate the influence mechanism of nonionic surfactant effect on methane desorption and diffusion in coal. In this paper, the desorption diffusion configuration of methane in coal under the action of nonionic surfactants was constructed by molecular dynamics simulation. The classical Wiser coal chemical structure model was selected as the initial configuration, along with two commonly used nonionic surfactants: decyl glucoside (APG) and coconut oil fatty acid diethanolamide (CDEA). The methane diffusion quantity, relative concentration distribution, radial distribution function and diffusion coefficient in the simulated equilibrium configuration were calculated and analyzed. The methane diffusion law under the action of nonionic surfactants with proportional concentration of 0.1 %,0.2 %,0.5 %, 0.8 % and 1.2 % was obtained. The results showed that the methane diffusion coefficient decreased while the water molecule diffusion coefficient increased with the increase of the proportionate concentration of nonionic surfactant. Methane and coal mainly interact in the form of strong van der Waals force, so nonionic surfactants have an inhibitory effect on the diffusion of coal seam methane. Comparing the effects of two nonionic surfactants, it was found that APG had a stronger inhibitory effect.