N-doped meso/macroporous carbon materials were synthesized by using melamine-formaldehyde resin as carbon precursor and silica spheres as a removable template. Scanning electron microscopy images reveal that the macropores of carbon materials can be modulated by changing the diameter of template. While the BET results verify that the template had no obvious effect to the mesopores of the materials. The as-synthesized carbon materials with a bimodal pores structure display a high surface nitrogen content of 30wt%. XPS analysis reveals that N atoms are mostly bound to the graphitic network in two forms, i.e. pyridinic and pyrrolic nitrogen.