High-quality activated carbon electrodes are crucial for improving the desalination capacity and electrochemical properties in capacitive deionization (CDI) progress. Biogas slurry (BS), a by-product of anaerobic fermentation, is abundant on earth, and improper treatment can lead to resource waste and environmental pollution. To effectively utilize the BS waste, we propose new light for the application of waste BS to CDI. In this research, porous carbon materials derived from BS were prepared by hydrothermal carbonization and KOH activation and also explored the optimal BS-derived porous carbon material (HA-0.5). As the KOH concentration increased, the BS-derived porous carbon materials (HA-x, x = 0, 0.5, 1.0, 1.5) showed a tendency of increasing and then decreasing specific surface area and pore volume. The obtained HA-x (x = 0.5, 1.0, 1,5) was superior to the inactivated HA-0. Under the KOH concentration of 0.5 mol/L, HA-0.5 had the highest specific surface area and the largest pore volume, with 1040 m2 g- 1 and 0.42 cm3 g-1, respectively. Suitable KOH also introduced more oxygen content to HA-0.5 (from 6.77 % in inactivated to 10.53 %), thus providing more active sites to be used for its electrochemical desalination properties. Consequently, HA-0.5 has a higher specific capacity (82.71 F g- 1, 5mv s- 1) and shows lower resistance to charge transfer. Importantly, HA-0.5 also had an excellent electrosorption capacity (42.99 mg g- 1) and a rapid adsorption rate of salt (1.41 mg g- 1 min- 1, 1.2 V). In addition, the desalting capacity of the HA-0.5 electrode remained above 80 % after 50 cycles, which is an excellent performance among the carbon material-based CDI electrodes. The results showed that high performance CDI electrode materials were successfully produced using the BS, Therefore, applying waste BS to CDI is desirable, as it provides more options for exploring new electrode materials.