Graphitic hollow porous carbon spheres (GHPCSs) have the advantages of a unique cavity structure, high surface area and excellent conductivity, and are promising electrode materials for energy storage. A Fe–tannic acid (TA) framework synthesized using TA as the carbon source and K3[Fe(C2O4)3] as a complexing agent, was self-assembled onto a melamine foam, which was converted to GHPCSs by carbonization, where the K3[Fe(C2O4) 3] also acts as an activating-graphitizing agent. The outer shell of the as-prepared GHPCSs has a large specific surface area, a micropore-dominated structure and excellent electrical conductivity, which ensure a large enough active surface area for charge accumulation and fast ion/electron transport in the partially graphitized carbon framework and pores. The optimum GHPCS has a high capacitance of 332.7 F g−1 at 1 A g−1. An assembled symmetric supercapacitor has a high energy density of 23.7 Wh kg−1 at 459.1 W kg−1 in 1 mol L-1 Na2SO4. In addition, the device has long-term cycling stability with a 92.1% retention rate after 10,000 cycles. This study not only provides an economic and time-saving approach for constructing GHPCSs by a self-assembly method, but also optimizes ion/electron transport in the carbon spheres to give them excellent performance in capacitive energy storage.