Recent research on carbon-based porous foams has made great progress to alleviate global clean water scarcity. However, it is still a challenge to produce carbon-based porous foams with both high evaporation performance and good mechanical property because of weak interface interactions between carbon-based material and matrix. Herein, we report an effective capillary enhancement strategy to construct robust oxygen-functionalized 3D carbon-based porous foams (OCPF) with abundant hydrophilic oxygen-functional groups from oxidized carbon fiber (OCF) and graphite oxide (GO). Owing to capillary enhancement strategy, a robust foam can be obtained, such as compression stress increases by 6–70 times, and compression modulus reaches 0.56–8.01 MPa, and the obtained foam also contains abundant oxygen-functionalized carbon materials to modulate water state. As a result, the optimized OCPFs show a high evaporation rate of ∼ 3.08 kg·m−2·h−1 with an efficiency of ∼ 94 % under one sun irradiation, which can be further raised to 7.89 kg·m−2·h−1 (5 cm height with 3 m·s−1 wind speed). Besides, the OCPFs also exhibit satisfied desalination and purification performance in actual saline water, domestic and industrial sewage, corrosive and oily wastewater. The feasible fabrication process, excellent performances, and potential applications of OCPFs could provide a new insight into the future development of high-performance and durable carbon-based solar evaporators for large-scale practical applications.