Nitrogen-doped hierarchical mesoporous/microporous carbon (NMMC) was prepared by synthesizing nitrogen-doped mesoporous titanium-carbide/carbon composite, followed by in situ chlorination of carbides. The NMMC possesses a high surface area (1344m2/g), large pore volumes (0.902cm3/g), narrowed mesopore-size distributions (centered at 4.6nm) and micropores drilled on the mesopore walls with the size of 0.70, 0.97 and 1.61nm. As an electrode material for supercapacitors, the obtained carbon exhibits excellent performance with a reversible specific capacitance as high as 325F/g in 1mol/L H2SO4 aqueous electrolytes contributed by the double-layer capacitance and pseudo-capacitance. The high nitrogen content (7.51 at%) plays an important role in the capacitance enhancement of NMMC, due to the faradaic redox reactions. Meanwhile, the micropores drilled on the mesopore walls can increase the specific surface area to provide more sites for charge storage.