Polyaniline (PANI) is one of the most widely used organic electrode materials for supercapacitors. It has advantages such as good environmental stability and low cost, whereas it is difficult to achieve high capacitance, good rate capability and long cycle life simultaneously. In this work, a series of porous polyaniline/carbon nanotube (PANI/CNT) composite materials are prepared by chemically grafting PANI on CNTs and creating interpenetrating pores via templating using CaCO3 nanoparticles, and then studied as electrode materials for supercapacitors. As PANI is covalently grafted on CNT networks formed in the electrode, the delocalization of electrons improves electron transport in the electrode and the stability of PANI in redox cycling process. The porous morphology created provides sufficient channels for the transport of ions. As a result, the optimized PANI/CNT composite exhibits a high capacitance of 1266 F g−1 at a specific current of 1 A g−1, and even at a specific current of 128 A g−1 the specific capacitance could reach 864 F g−1. Moreover, after cycling tests of 10,000 cycles, it remains 83% of its capacitance at the first cycle. The excellent rate performance and cycle stability of the porous PANI/CNT composite makes it a promising high-performance electrode material for supercapacitors.