Supercapacitors with high power density and long cycle life have shown great potential in energy storage supply for modern electronic devices. Among the component parts of supercapacitors, electrode materials with high electrical conductivity, large surface area and porosity are critical to the energy storage performances of devices. Here, we report a porous g-C3N4 covered MOF-derived nanocarbon material with large specific surface area and high nitrogen doping level as an electrode material for supercapacitors. The large surface area provides high capacity for ion accommodation during electrochemical processes, and the high nitrogen doping facilitates electron and ion transport with extra pseudocapacitance. The supercapacitor based on the as-synthesized material delivers a high specific capacity of 106 F g-1 at current density of 1 A g-1 as well as good rate capability. Furthermore, the device presents good cycling stability with capacitance retention of 91% even after 10 000 cycles at 1 A g-1 under 0.8 V. This study presents a new insight into the design of nanocomposite materials with high energy storage capability and will accelerate the practical application of supercapacitors in future. © 2019 The Royal Society of Chemistry.