Nitrogen-containing carbon nanotubes (CNTs) with open end and low specific surface area were prepared via the carbonization of polyaniline (PANI) nanotubes synthesized by a rapidly mixed reaction. On the basis of analyzing the morphologies and structures of the original and carbonized PANI nanotubes, the electrochemical properties of PANI-based CNTs obtained at different temperatures as electrode materials for supercapacitors using 30wt.% aqueous solution of KOH as electrolyte were investigated by galvanostatic charge/discharge and cyclic voltammetry. It was found that the carbonized PANI nanotubes at 700°C exhibit high specific capacitance of 163Fg−1 at a current density of 0.1Ag−1 and excellent rate capability in KOH solution. Using X-ray photoelectron spectroscopy measurement the nitrogen state and content in PANI–CNTs were analysed, which could play important roles for the enhancement of electrochemical performance. When the appropriate content of nitrogen is present, the presence of pyrrole or pyridone and quaternary nitrogen is beneficial for the improvement of electron mobility and the wettability of electrode.