Water and electricity scarcity are two global challenges, especially in arid and remote areas. Harnessing ubiquitous moisture and sunlight for water and power generation is a sustainable route to address these challenges. Herein, we report a moisture-induced energy harvesting strategy to realize efficient sorption-based atmospheric water harvesting (SAWH) and 24-hour thermoelectric power generation (TEPG) by synergistically utilizing moisture-induced sorption/desorption heats of SAWH, solar energy in the daytime and radiative cooling in the nighttime. Notably, the synergistic effects significantly improve all-day thermoelectric power density (~346%) and accelerate atmospheric water harvesting compared with conventional designs. We further demonstrate moisture-induced energy harvesting for a hybrid SAWH-TEPG device, exhibiting high water production of 750 g m−2, together with impressive thermoelectric power density up to 685 mW m−2 in the daytime and 21 mW m−2 in the nighttime. Our work provides a promising approach to realizing sustainable water production and power generation at anytime and anywhere.