The traditional strong alkaline activation method for preparing porous carbon faces with complex preparation processes, equipment corrosion, excessive disordered microporous structures, and environmental pollution. Hence, a green, facile and sustainable method is proposed for synthesizing N/O co-doped porous carbon derived from polyacrylamide gel with the assistance of recyclable sodium chloride (NaCl) template. NaCl template is dissolved in gel with water and can give full play to the template effect after recrystallization. Due to a suitable specific surface area (499.8 m2 g−1) and massive N (11.38 at. %) and O (8.71 at. %) functional groups, the optimized NPC-5 electrode possesses a high specific capacitance of 283.3 F g−1 at 0.5 A g−1, superior rate characteristics and excellent cycle stability in 6 M KOH aqueous electrolyte. In addition, the constructed NPC-5//NPC-5 symmetric supercapacitor shows a high energy density of 34.0 Wh kg−1 in 1 M ZnSO4 aqueous electrolyte. More importantly, the assembled Zn//ZnSO4//NPC-5 hybrid capacitor shows a high capacity of 115.44 mAh g−1 and an energy density of 85.3 Wh kg−1.