Abstract Highly porous N‐doped carbons have been successfully prepared by using KOH as activating agent and polypyrrole (PPy) as carbon precursor. These materials were investigated as sorbents for CO 2 capture. The activation process was carried out under severe (KOH/PPy = 4) or mild (KOH/PPy = 2) activation conditions at different temperatures in the 600–800 °C range. Mildly activated carbons have two important characteristics: i) they contain a large number of nitrogen functional groups (up to 10.1 wt% N) identified as pyridonic‐N with a small proportion of pyridinic‐N groups, and ii) they exhibit, in relation to the carbons prepared with KOH/PPy = 4, narrower micropore sizes. The combination of both of these properties explains the large CO 2 adsorption capacities of mildly activated carbon. In particular, a very high CO 2 adsorption uptake of 6.2 mmol·g −1 (0 °C) was achieved for porous carbons prepared with KOH/PPy = 2 and 600 °C (1700 m 2 ·g −1 , pore size ≈ 1 nm and 10.1 wt% N). Furthermore, we observed that these porous carbons exhibit high CO 2 adsorption rates, a good selectivity for CO 2 ‐N 2 separation and it can be easily regenerated.