Three-dimensional carbon aerogels with high surface area, low cost and excellent structural stability, have shown extraordinary promise for supercapacitors (SCs). Pore-forming and heteroatom-doping have been reported to play an important role in improving the power and energy densities of nanostructured carbon electrodes. We propose novel bamboo-like N/S-codoped carbon nanotube aerogels (NS–CNAs) facilely fabricated through MnO2-templated polymerization, freeze-drying and calcination. The cryptomelane-type MnO2 nanowires are served as self-sacrificing templates and oxidative initiators for polymerization of pyrrole in acidic environment. XPS analysis can confirm the N content of 4.09% and the S content of 0.66%, which are mainly derived from PPy with nitrogen-containing skeletons and PSS with sulfonic acid groups respectively. Based on porous structure and N/S codoping, the assembled NS-CNA SC can provide high supercapacitive performances, such as a specific capacitance of 328 F g−1 (at 1 A g−1), the rate capability of 66.5% (from 1 A g−1 to 10 A g−1), an energy density of 45.6 Wh kg−1 (at 0.5 kW kg−1) and the capacity retention of 97.4% (after 10,000 cycles), opening up a highly-efficient approach to developing high-performance supercapacitors.