Mesoporous carbons containing up to at.% N and at.% O and exhibiting graphitic character have been prepared from Ni(II) and Fe(II) phthalocyanines by direct pyrolysis or by HTC + pyrolysis, and subsequently applied as supercapacitor materials. No mesoporous templates or doping post-treatments were used, and the catalytic effect of Ni(II) and Fe(II), naturally present in the precursor molecules, allowed obtaining graphitic carbons at temperatures 900 C. Metals were encapsulated in the core of onion–like structures with no contact with the electrolyte, so that electrodes were prevented from degradation during device operation. The materials exhibited high rate capabilities up to 1 V s1 , higher interfacial capacitances than a wide variety of materials possessing higher surface areas, and high capacitance retentions up to 99% at 5 A g1 current density throughout 10 000 charge–discharge cycles. | Structure and electrochemical properties of carbon nanostructures derived from nickel II and iron II phthalocyanines