Nitrogen-doped porous carbons with uniformed pore structure and large surface area are promising materials as sorbents for acidic gases and electrocatalysts for oxygen-related reactions. Herein, we report the synthesis of nitrogen-doped porous carbon (NPC) materials through carbonization of imidazole-functionalized polyhedral oligomeric silsesquioxane (POSS) at 900 °C followed by removal of POSS blocks. The imidazole moieties act as both nitrogen and carbon sources and the POSS blocks are nano-sized hard templates. The resulting NPC has a surface area of 980 m2g−1 with average pore size of 4.7 nm and the pyridinic nitrogen in the formed NPC contribute to about 33% of overall nitrogen species. The carbon dioxide adsorption property and the electrocatalytic performance toward oxygen reduction reaction of the formed NPC are further evaluated. The formed NPC materials exhibit a total carbon dioxide adsorption capacity of 0.30 mmolg−1 at 30 °C under the partial pressure of carbon dioxide of 0.2 bar. Although the formed NPC is less active than commercial Pt/C catalyst for oxygen reduction reaction, the half-wave potential shifts to the negative side by only about 10 mV after 10000 cycling tests, demonstrating the great stability of the formed NPC materials.