The search for a better carbon dioxide (CO2) capture material is attracting significant attention because of an increase in anthropogenic emissions. Porous materials are considered to be among the most promising candidates. A series of porous, nitrogen-doped carbons for CO2 capture have been developed by using high-yield carbonization reactions from task-specific ionic liquid (TSIL) precursors. Owing to strong interactions between the CO2 molecules and nitrogen-containing basic sites within the carbon framework, the porous nitrogen-doped compound derived from the carbonization of a TSIL at 500 °C, CN500, exhibits an exceptional CO2 absorption capacity of 193 mg of CO2 per g sorbent (4.39 mmol g−1 at 0 °C and 1 bar), which demonstrates a significantly higher capacity than previously reported adsorbents. The application of TSILs as precursors for porous materials provides a new avenue for the development of improved materials for carbon capture.