High-surface-area N-decorated nanoporous carbons have been successfully synthesized using the N-rich metal-organic framework ZIF-8 as a template and precursor along with furfuryl alcohol and NH4OH as the secondary carbon and nitrogen sources, respectively. These carbons exhibited remarkable CO2 adsorption capacities and CO2/N2 and CO2/CH4 selectivities. The N-decoration in these carbons resulted in excellent activity for the oxygen reduction reaction. Samples NC900 and NC1000 having moderate N contents, high surface areas, and large numbers of mesopores favored the four-electron reduction pathway, while sample NC800 having a high N content, a moderate surface area, and a large number of micropores favored the two-electron reduction process.