Nitrogen-doped nanoporous carbons were synthesized by a solvent-free mechanochemically induced one-pot synthesis. This facile approach involves the mechanochemical treatment and carbonization of three solid materials: potassium carbonate, urea, and lignin, which is a waste product from pulp industry. The resulting nitrogen-doped porous carbons offer a very high specific surface area up to 3000 m g and large pore volume up to 2 cm g . The mechanochemical reaction and the impact of activation and functionalization are investigated by nitrogen and water physisorption and high-resolution X-ray photoelectron spectroscopy (XPS). Our N-doped carbons are highly suitable for electrochemical energy storage as supercapacitor electrodes, showing high specific capacitances in aqueous 1 m Li SO electrolyte (177 F g ), organic 1 m tetraethylammonium tetrafluoroborate in acetonitrile (147 F g ), and an ionic liquid (1-ethyl-3-methylimidazolium tetrafluoroborate; 192 F g ). This new mechanochemical pathway synergistically combines attractive energy-storage ratings with a scalable, time-efficient, cost-effective, and environmentally favorable synthesis.