Nitrogen-containing conducting polymer-derived porous carbons are attracting vast interest in energy applications. However, polymer-derived porous carbons are limited by low electrical conductivity. Here, we report a highly conductive nitrogen-containing activated porous carbon nanostructure (PNAC) derived from poly (para-phenylenediamine), which is an aromatic diamine polymer. PNAC exhibits high electrical conductivity of 624 S/m that is significantly higher than activated graphene and commercial activated carbons. The porous carbon displays hierarchical pore architecture with high nitrogen content of 6.02 atomic %. PNAC was fabricated for counter electrode application in dye-sensitized solar cells. The electrocatalytic and photovoltaic study of the PNAC counter electrode displays power conversion efficiency ~6.14% which is as good as the standard platinum counter electrode. The material was also fabricated as electrodes for supercapacitors and their electrochemical performance was studied using two-electrode symmetric cell configuration. PNAC demonstrates high specific capacitance of 162 F/g in 1M H2SO4 electrolyte at 1 A/g, high rate capability and excellent cycling stability. © 2019 Elsevier B.V.