• A simple polymerization reaction between p-benzaldehyde and 2,6-diaminopyridine yields interconnected carbon spheres with high N/O doping.
• Optimizing the PMEC:KOH mass ratio (1:1) produces a microporous carbon with a high surface area of 2599.76 m2 g−1 and superior specific capacitance of 303.2 F g−1 at 0.5 A g−1.
• The assembled symmetric supercapacitor delivers a high energy density of 11.3 Wh kg−1 at a power density of 250 W kg−1 in KOH electrolyte.
• The strategy highlights the potential of N/O co-doped microporous carbon for high-performance aqueous supercapacitors.