Monolithic electrodes show a great advantage in energy storage devices. Nitrogen/oxygen co-doped carbons sponges (NOCSs) prepared from carbonized melamine foams are directly applied as the supercapacitor electrodes without any additives and binders. The influence of carbonization temperatures from 650 to 950°C on the heteroatom (N and O) content, surface area, graphitization degree, and capacitor performance of carbon sponges are systematically investigated, and it is found that NOCS-850 delivers a better overall capacitive properties for its balanced heteroatom content, surface area, and graphitization degree. It possess specific capacitances of 338 F g À 1 at a scan rate of 1.0 mV s À 1 and 168.3 F g À 1 at a current density of 0.5 A g À 1 in 1.0 M H 2 SO 4. After 5000 cycles of repeated charging/discharging process, the capacitance retention remains 107%. When being assembled into an all-solid-state supercapacitor, the NOCS-850 has a energy density of 5.38 Wh kg À 1 at a power density of 233 W kg À 1. A red light-emitting diode can be successfully lighted by three connected all-solid-state supercapacitors of NOCS-850, illustrating its potential application in energy storage field.