N-doped porous carbon materials derived from urea-modified lignin were prepared via efficient KOH activation under carbonization. The synthesized N-doped carbon materials, which displayed a well-developed porous morphology with high specific surface area of 3130 m2 g−1, were used as electrode materials in symmetric supercapacitors with aqueous and solid electrolytes. In consistent with the observed physical structures and properties, the supercapacitors exhibited specific capacitances of 273 and 306 F g−1, small resistances of 2.6 and 7.7 Ω, stable charge/discharge at different current densities for over 5000 cycles and comparable energy and power density in 6 mol L−1 KOH liquid and KOH-PVA solid electrolytes, respectively.