Series of sulfur-doped porous carbons were prepared by using glucose as carbon source and sodium dodecyl sulfate as sulfur source to synthesize sulfur-based carbon precursor and KOH as activator. Pore structure parameters and sulfur content of the prepared carbon materials could be facility regulated by controlling the ratio of KOH/sulfur-based carbon precursor and activation temperature, and their adsorptive separation properties towards CO2 and CH4 were investigated. Results showed that the higher the ultra-microporous volume and the S content of the prepared sulfur-doped porous carbon were, the larger the CO2 and the CH4 adsorption capacity were. The maximum adsorption capacity of CO2 (6.54 mmol/g, 273.15 K and 101 kPa, hereinafter) and CH4 (2.98 mmol/g), and the excellent selectivity of CO2/N2 (75.7) and CH4/N2 (22.8) were achieved by ACS-700-2 because of its higher ultra-microporous pore volume and the highest S content. Permeation experiment, cycle stability test and adsorption thermodynamics experiment show that the prepared S-doped porous carbon had good application potential in the separation and enrichment of CO2 in flue gas and CH4 in coalbed methane. In addition, the pore formation mechanism of sulfur-doped porous carbon was discussed.