Hierarchical porous graphitic carbon material is obtained by one-step vapor-assisted catalytic graphitization accompanied with chemical activation of phenolic resin. Water vapor is used to enhance the catalytic graphitization process by etching carbon layers coated on metal nanocatalysts to maintain their high catalytic activity, and the resultant hydrogen and carbon monoxide as strong reduction gases arising from water-gas shift reaction can promote the transformation of metal ions to metal catalysts. Thus, the resultant graphitic carbon exhibits hierarchical pore structure, large surface area and high graphitic degree, which is advantageous over conventional activated carbon materials in electrochemical energy storage. The applications of hierarchical porous graphitic carbon as electrode materials for supercapacitors, and host for sulfur in lithium-sulfur cells is demonstrated, which shows remarkably enhanced electrochemical performance due to the unique structure.