So far, nitrogen doped carbon materials (NCMs) have been prepared by various methods for use as the active materials in supercapacitors. However, the main reason for delay in starting the practical use and commercializing the NCMs in supercapacitors is the use of very especial organics as well as many steps of the synthesis. Here we demonstrate that the NCMs can be prepared by a simple route on a very large scale using any organic anions. Nitrogen doped carbon nanosheets were prepared by design of a layered nanoreactor including gallate and nitrate anions. Under heat-treatment, the reaction between gallate and nitrate anions resulted in the production of NCM nanosheets which could be used as electrode material in supercapacitor. The produced carbon material shows highly porous structures with suitable micro/mesopores, appropriate nitrogen content and ultrahigh specific capacitance for this type of active material in supercapacitors. Electrochemical analyses declare a perfect rectangular CV, very low Ohmic resistance for charge–discharge curves at current densities up to 4 A/g and a high specific capacitance (255.5 F/g at the current density of 0.5 A/g) for the produced nanosheets.