Nitrogen-sulfur codoped porous carbon (NSPC) is a promising advanced material, showing great application potential in greenhouse gas capture and energy storage. Here, a novel NSPC with controllable porous structure was fabricated via pyrolysis and activation of N, -containing polycondensates, which were synthesized by onepot polycondensation reaction of triglycidyl isocyanurate, glucose and thiourea. The obtained sample NSPC-1-650 showed cross-linked spherical morphology with uniform pore size (2.61 nm), large specific surface areas (1927.46 m(2).g(-1)), and the doping of nitrogen (4 wt%) and sulfur (2 wt%), which leaded to a good CO2 adsorption capability (5.56 mmol.g(-1) at 298.15 K, 5 bar) and excellent stability. Additionally, when used as a supercapacitor, the NSPC-1-650 sample showed an ultrahigh specific capacitance (224.3F.g-(1 )at 1 Ag-1 in 6 M KOH electrolyte), an excellent rate capability, and good stability (retained > 85% capacity after 5000 cycles). Notably, the all solid-state symmetrical NSPC-1-650-based supercapacitors delivered a high energy density (the maximal value = 7.8 Wh.Kg(-1)) and power density (the maximal value = 4500 W.Kg(-1)). These results suggest that NSPC-1-650 be a competitive candidate as a CO2 adsorbent and supercapacitor.