In this work, N-doped hierarchically porous carbon (PDHC) has been prepared when MnO 2 nanotube and polyaniline are selected as self-sacrificial reaction template and carbon source, respectively. Benefiting from the suitable N-doping degree inherited from polyaniline, and the hierarchical porous structure originated from the synergistic adjustment of self-sacrificial template and activation treatment, PDHC exhibits significant advantages for electrochemical energy storage. Typically, the PDHC has the high specific capacitance (467 F g −1 at 1 A g −1 ) and rate performance (71.9% capacitance retention at 20 A g −1 ) in three-electrode systems. PDHC-based coin type symmetric supercapacitors are assembled with 1 M H 2 SO 4 electrolytes and ionic liquid electrolytes, respectively, and they all exhibit a considerable synergistic power-energy output (752 W kg −1 at 31.1 Wh kg −1 and 750 W kg −1 at 74.8 Wh kg −1 ) and an acceptable cycling stability (6.5% and 13.9% loss over 5000 cycles). Meanwhile, the electrocatalytic performance of PDHC towards oxygen reduction reaction is also investigated, where a superior catalytic activity and a outstanding durability via 4e - pathway in the alkaline solution are confirmed, heralding the possibility of its practical application in fuel cells. • N-doped hierarchically porous carbon is prepared by MnO 2 as self-sacrificial template. • The sample’s pore structure is regulated by MnO 2 template and activation treatment. • The sample shows high specific capacitance and superior rate capability. • The sample also exhibits excellent electrocatalytic activity for ORR.