Heteroatom-doped 3D porous carbon materials have been synthesized by utilizing hydroxyapatite in pig bones as a self-template and used as electrode materials for symmetric supercapacitors, which exhibit ultra-high energy density both in an aqueous electrolyte and organic electrolyte, showing great potential applications in the next generation of energy storage and conversion devices.