Pyrolysis gradually becomes a promising green method to dispose the sewage sludge who has brought serious problems to environment. In this study, hierarchical porous hollow carbon nanospheres are directly obtained by specific carbonization/activation procedures using sewage sludge as the only precursor for the first time. The resultant carbon possesses tailor-made hierarchically porous structure with larger surface area (1518.40 m2 g−1), high pore volume (1.21 cm3 g−1), and rich oxygenic functional groups, which is favorable for lithium ion diffusion and can better enhance the ionic conductivity in an electrode system. As anode for li-ion battery, the carbon displays superior discharge capacity, which reaches 1168.9 mAh g−1 at 0.1 A g−1 and 287.1 mAh g−1 at 2 A g−1. And the capacitance retention is 98.7% over 100 cycles at 0.1 A g−1. Therefore, it is anticipated that such a pollutants-derived carbon can facilitate the development of new green and sustainable pathways for the construction and design of well-defined porous carbon nanospheres to ease energy and environmental issues.