Solar desalination is recognized as one of the eco-friendly and sustainable ways to alleviate the global freshwater crisis but still requires further research, especially in developing high-performance evaporators. Herein, we prepared an efficient carbon nanotubes (CNTs)@polyvinyl alcohol (PVA) nanofibrous hydrogel evaporator by electrospinning and subsequently chemical cross-linking treatment. Due to CNTs with good light absorption capacity, the evaporator exhibited an excellent light absorption capacity (>90%) throughout the full spectrum range (250–2500 nm). Meanwhile, the interconnected pores from electrospinning, as well as the intermediate water in the hydrogel, ensured the prepared evaporator with a favorable evaporation rate of up to 2.16 kg m−2 h−1 and photothermal conversion efficiency of ∼88.13% under one solar light intensity. For long-term seawater desalination, the CNTs@PVA nanofibrous hydrogel evaporator also presented superior salt resistance, durability and good self-cleaning properties. Besides, various non-volatile pollutants can be completely removed by the prepared evaporator during the wastewater purification. As a result, this work is considered to provide a new direction for developing high-performance evaporators to provide freshwater through seawater desalination and wastewater purification.