A series of nitrogen doped porous carbons are prepared using a simple and economic template carbonization method, in which nano-CaCO3 and ethylenediamine (EDA) and carbon tetrachloride (CTC) serve as a template and nitrogen-containing carbon precursors, respectively. The textural parameters of all the obtained carbon materials are tunable. The porosity and nitrogen content of the nitrogen doped porous carbons strongly depend on the dosage of nano-CaCO3. When the ratio of CaCO3 to the sum weight of EDA and CTC increases from 0.2 to 0.4, the specific surface area increases from 783.72 to 2535.09m2 g−1, meanwhile the nitrogen content decreases from 16.13 to 9.47wt%. While when the ratio of CaCO3 to the sum weight of EDA and CTC is moderate, the as-prepared nitrogen doped porous carbons (NPC-0.3) contains as high as 13.45wt% of nitrogen has a balanced specific surface areas of 1276.14m2 g−1, exhibits the largest specific capacitance of 226Fg−1 at a current density of 0.1Ag−1 in 1M H2SO4 aqueous electrolyte, due to the co-contribution of double layer capacitance and pseudo-capacitance. Additionally, it shows excellent rate capability (capacitance retention ratio of 58.4% at a current density of 30Ag−1) and good cycling stability (no capacitance decay over 10 000 charge-discharge cycles), making it a promising electrode material for supercapacitors.