• Development of closed-cell hydrogel foams via a controlled foaming − gelation technique. • Demonstration of self-contained solar evaporation and desalination. • Realization of a single-stage water purifier for efficient clean water production. Solar-powered interfacial evaporation has emerged as a sustainable technology for clean water production with a minimized carbon footprint. Fabrication of three-dimensional (3D) steam generators via conventional processing techniques (sol–gel and template-assisted methods) remain one of the main roadblocks toward mass production and scalable applications. In this study, 3D hydrogel foams based on biopolymer composites are developed via a controlled foaming − gelation technique and applied to a monolithic interfacial steam generator. The designed closed-cell structures deliver many important form-factors to the hydrogel foams, such as light-weight, low-cost, low thermal insulation and efficient water diffusion. The hydrogel foam with a maximum height of 3.2 cm attains a high water evaporation rate of 2.12 kg m −2 h −1 and a high cost-effectiveness of 2692 g h −1 $ −1 under one sun. A single-stage water purification system is fabricated based on the high-performing hydrogel foam. Because of its self-floating structure and enhanced passive cooling on open water, the system attains a maximum clean water collection rate of 0.71 L m −2 h −1 under real sky and surpasses a majority of single-stage solar stills. This work demonstrates the rational fabrication of hydrogel foams and combines high-performance solar evaporation with other intriguing properties (i.e., cost-efficient, scalable, anti-biofouling, self-floating and anti-overturning). The system-level design enables facile scale-up of clean water production.