Capacitive deionization (CDI) has been a promising technique to obtain fresh water by electrosorption of charged ionic species in seawater/brackish water. Its performance is highly dependent on the physical and chemical properties of CDI electrode materials. Herein, Ndoped porous carbon (NPC) with a N content of 1.66 at.% was fabricated using soybean shell as starting material by a facile pyrolysis approach with the assistance of KHCO 3 in N 2 atmosphere. The as-prepared NPC with porous structure and high surface area (1036.2 m 2 g-1) was further functionalized with sulfonic groups in an aryl diazonium salt solution to obtain sulfonyl functionalized NPC (S-NPC) with a surface area of 844.0 m 2 g-1. S-NPC as cathode material was assembled into an asymmetric CDI device with aminated activated carbon (A-AC) as anode material, exhibiting superior CDI performance with an adsorption capacity of 15.5 mg g-1 and an average adsorption rate of 0.44 mg g-1 min-1 in 40 mg L-1 NaCl solution at an applied voltage of 1.2 V. As a proof of concept study, such configured CDI device was also powered for the first time by a Zn-air battery made from NPC with an open-circuit voltage of 1.28 V owing to N doping in soybean shell derived porous carbon with superior oxygen reduction reaction (ORR) activity, delivering an impressive CDI performance with an adsorption capacity of 15.8 mg g-1 and an average adsorption rate of 0.37 mg g-1 min-1 in 40 mg L-1 NaCl solution. This superior CDI performance can be due to S-NPC with high surface area, porous structure and surface rich negative charges resulted from sulfonyl functionalization, favourable for adsorption active sites exposure and mass transport of Na + ions.