Polyacrylonitrile/poly(methyl methacrylate) (PMMA) fibers containing graphene are prepared by the electrospinning method, and hierarchical porous carbon nanofibers (CNFs) are obtained after subsequent heat treatment. The hierarchical porous CNFs have an improved structure and properties because of the increased surface area, unique nanotexture and increased electrical conductivity due to the dispersion of graphene. The carbonized fiber exhibits a high surface area (over 500m2 g−1) as result of the narrow ultramicro- and mesopore size distributions (centered at approximately 0.7 and 3.7nm, respectively), and a broad mesopore size distribution ranging from 10 to 50nm. The hierarchical pore structures are introduced by the evolution of small gas molecules during the decomposition of the PMMA during heat treatment. The highest specific capacitance of the CNFs is 128Fg−1, and the energy densities are 16.0–21.4Whkg−1 in an aqueous solution and 75.0–58.2Whkg−1 in an organic electrolyte over a power density range of 400–20,000Wkg−1. Under constant current charging/discharging at 1mAcm−2 for 100 cycles, the stability of the CNFs in a 6M KOH aqueous electrolyte decreases by ∼17% compared with the initial specific capacitance value.