A simple but efficient template carbonization method has been implemented for the production of highly nanoporous carbon by the reaction of potassium biphthalate with zinc, magnesium, or aluminum metal. The mass ratio and carbonization temperature are pivotal factors influencing the structures of the carbons. It explicitly reveals that the carbons produced in the potassium biphthalate-zinc metal system exhibit superior porosities and better electrochemical performances. Taking the Zn-3:1-900 sample as an example, it has a large BET surface area of 1605.1 m2 g−1 and a high total pore volume of 1.18 cm3 g−1. A large specific capacitance of 338.2 F g−1 is achieved at a current density of 1 A g−1 and it can retain a 100.5 F g−1 even at a high current density up to 100 A g−1 when measured in a three-electrode system. It also exhibits a high energy density of 76.7 Wh kg−1 obtained in a two-electrode system. Furthermore, in the two kinds of electrode systems, all of the carbons display excellent cycling stabilities.