Separation of CO2/CH4/N2 is significantly important from the view of environmental protection and energy utilization. In this work, we reported nitrogen (N)-doped porous carbon spheres prepared from sustainable biomass glucose via hydrothermal carbonization, CO2 activation, and urea treatment. The optimal carbon sample exhibited a high CO2 and CH4 capacity, as well as a low N2 uptake, under ambient conditions. The excellent selectivities toward CO2/N2, CO2/CH4, and CH4/N2 binary mixtures were predicted by ideal adsorbed solution theory (IAST) via correlating pure component adsorption isotherms with the Langmuir−Freundlich model. At 25 °C and 1 bar, the adsorption capacities for CO2 and CH4 were 3.03 and 1.3 mmol g−1, respectively, and the IAST predicated selectivities for CO2/N2 (15/85), CO2/CH4 (10/90), and CH4/N2 (30/70) reached 16.48, 7.49, and 3.76, respectively. These results should be attributed to the synergistic effect between suitable microporous structure and desirable N content. This report introduces a simple pathway to obtain N-doped porous carbon spheres to meet the flue gas and energy gas adsorptive separation requirements.