Porous carbon derived from bio-based sources is highly regarded as a promising adsorbent material, attributed to its exceptional CO2 uptake performance and favorable CO2/N2 selectivity. In this study, we employed a one-step chemical activating technique to fabricate self-heteroatom-doped porous carbon utilizing chitosan as a carbon precursor and KOH as chemical activating reagent. Subsequent activation processes resulted in the porous carbons possessing an excess amount of nitrogen functionality and advanced textural feature. Remarkably, a high CO2 capture amount of 4.40 mmol/g was accomplished at 25 °C and 1 bar, accompanied by a significant CO2/N2 selectivity of 21 for the dual gas blend. The gas adsorption mechanisms were thoroughly discussed, elucidating the factors contributing to the exceptional performance. The superior adsorption and separation capabilities, enhanced recyclability and effective dynamic adsorption capability, establish this N-enriched carbon as a potential adsorbent for CO2 uptake. The present work presents a novel approach for designing high-performance carbon-based CO2 adsorbents.