Metal-doped carbon xerogels (M-DCXs, M=Co, Fe, and Ni) have been obtained by a cost-effective sol–gel method using metal nitrates as catalyst, followed by solvent exchange and then dried in ambient conditions before carbonization procedure. It is found that the existence of metals could also lead to 2 dimensional (2D) channel-like nanostructure caused by layered deposits of graphite during the carbonization procedure. The performance of M-DCXs for electric double-layer capacitors is proved to be associated with their nanostructure. As a result, the as-prepared Co-DCX can make full use of the 2D channel-like nanostructure of ordered graphite and 3D connectivity of mesoporous structure of carbon xerogel, and thus, exhibits the highest capacitance of 84Fg−1. At the same time, Co-DCX also shows a stable long-term cycling behavior with less than 2% loss of capacitance after 2000 cycles.