We report the largely improved electrochemical capacitance of polypyrrole-derived microporous carbon nanospheres (MCNs, 80-100 nm in diameter) containing nitrogen functional groups. We have investigated the electrochemical properties of precursor polypyrrole nanospheres (PNs, with a high N/C ratio and low surface area) and as-derived carbon nanospheres (CNs, with a moderate N/C ratio and low surface area) prepared by carbonizing PNs at different temperatures, and MCNs (with a low N/C ratio and high surface area) obtained by chemical activation of CNs. The samples are thoroughly characterized by transmission electron microscopy (TEM), X-ray diffraction (XRD), Raman spectroscopy, thermogravimetric analysis (TGA), nitrogen sorption, elemental analysis, and X-ray photoelectron spectroscopy (XPS). It is found that MCNs with a high surface area and N-doping species exhibit much better capacitive performance compared to the PNs and CNs, and commercial carbon blacks (XC-72 and BP2000) as well. The MCN sample gives a reversible specific capacitance of similar to 240 F g(-1) for 3000 cycles in aqueous media as a result of combined advantages of high electrochemical activity of doped heteroatoms (N and O) and accessible well-developed porosity, demonstrating the promising use in high-energy-density supercapacitors.