A nitrogen modified graphdiyne is investigated concerning its performance for hydrogen purification from CH 4 and CO by density functional theory with dispersion correction and transition state theory. After nitrogen doping, the porous N-graphdiyne nano-mesh shows a reduced H 2 diffusion barrier and increased CH 4 /CO diffusion barriers, hence leading to an enhanced hydrogen purification capability.Hydrogen energy is one of the most promising solutions to the issues of dwindling fossil fuel supply and escalating greenhouse effects. Hydrogen as an energy carrier possesses the highest energy density per weight, 1 produces only water aer oxidation, and its energy conversion efficiency by fuel cells is much higher than the current combustion technology of fossil fuels. 2 Currently the dominant technology for hydrogen production is steam methane reforming which produces syngas, a mixture of H 2 and CO, followed by the H 2 purication process. 3 The puri-cation process is of vital importance to generate pure hydrogen gas, since the anode catalyst material of a fuel cell, Pt, would be poisoned by a trace amount of remaining CO in the hydrogen stream. 4 At the meantime, the remaining CH 4 component in the stream should be ltered out.A signicant difference between H 2 and CO/CH 4 is their atomic sizes as shown in Fig. 1a-c; this difference could be utilized for a separation process by membrane technology. 5-7 In the past, various membranes have been investigated for the purpose of hydrogen separation, including metallic, silica, † Electronic supplementary information (ESI) available: Computational details, gas transmit across graphdiyne, and frequency analysis. See