High Resolution Image Download MS PowerPoint Slide Nitrogen-doped hierarchical porous carbons with a rich pore structure were prepared via direct carbonization of the poly(ionic liquid) (PIL)/potassium ferricyanide compound. Thereinto, the bisvinylimidazolium-based PIL was a desirable carbon source, and potassium ferricyanide as a multifunctional Fe-based template, could not only serve as the pore-forming agent, including metallic components (Fe and Fe 3 C), potassium ions (etching carbon framework during carbonization), and gas generated during the pyrolysis process, but also introduce the N atoms to porous carbons, which were in favor of CO 2 capture. Moreover, the hierarchically porous carbon NDPC-1-800 (NDPC, nitrogen-doped porous carbon) had taken advantage of the highest specific surface area, exhibiting an excellent CO 2 adsorption capacity and selectivity compared with NDC-800 (NDC, nitrogen-doped carbon) directly carbonized from the pure PIL. Furthermore, its hierarchical porous architectures played an important part in the process of CO 2 capture, which was described briefly as follows: the synergistic effect of mesopores and micropores could accelerate the CO 2 molecules’ transportation and storage. Meanwhile, the appropriate microporous size distribution of NDPC-1-800 was conducive to enhancing CO 2 /N 2 selectivity. This study was intended to open up a new pathway for designing N-doped porous carbons combining both PILs and the multifunctional Fe-based template potassium ferricyanide with wonderful gas adsorption and separation performance.