A novel microporous templated carbon material doped with nitrogen is synthesized by using a two-step nanocasting process using acrylonitrile (AN) and propylene as precursors, and Na–Y zeolite as a scaffold. Liquid-phase impregnation and in situ polymerization of the nitrogenated precursor inside the nanochannels of the inorganic scaffold, followed by gas-phase impregnation with propylene, enables pore-size control and functionality tuning of the resulting carbon material. The material thereby obtained has a narrow pore-size distribution (PSD), within the micropore range, and a large amount of heteroatoms (i.e., oxygen and nitrogen). In addition, the carbon material inherits the ordered structure of the inorganic host. Such features simultaneously present in the carbon result in it being ideal for use as an electrode in a supercapacitor. Although presenting a moderately developed specific surface area (SBET = 1680 m2 g–1), the templated carbon material displays a large gravimetric capacitance (340 F g–1) in aqueous media because of the combined electrochemical activity of the heteroatoms and the accessible porosity. This material can operate at 1.2 V in an aqueous medium with good cycleability—-beyond 10 000 cycles—and is extremely promising for use in the development of high-energy-density supercapacitors.