Hierarchical nanoporous carbon (NPC) with great surface area and developed pore size distribution has been intently concerned. Herein, we report a facile method coupling template nanocasting and self-activation to fabricate nanoporous carbon with continuous micro, meso and macro pores, in which CaCO3 acted as template and activation reagent while the flour was the carbon precursor. Effects of mass ratio of CaCO3 to flour and carbonized temperature on the pore structures of NPC were investigated by nitrogen adsorption-desorption isotherms and SEM analysis. Another kind of carbon was prepared by directly mixed powder CaCO3 with flour carbonized at 800 °C (NPC-p) to comparatively investigate the pore fabricating mechanism. Results shown that carbonized at 800 °C was favorable to fabricate the continuous macro, meso and micro pores. The resulted NPC in a mass ratio of 1 to 2 had the considerable SBET and VT of 575.4 m2/g and 0.704 cm3/g, respectively. Only surface activation was observed for NPC-p. Nanocasting of the powder CaCO3 contributed to fabricate macropores and the CO2 activation contributed to meso- and micropores. Coupling activation and nanocasting effect due to the decomposition of CaCO3 template into CO2 and CaO was ascribed to synthesize the nanoporous carbon.