Hydrogels have found broad applications in various engineering and biomedical fields, where the shape and size of hydrogels can profoundly influence their functions. Although numerous methods have been developed to tailor 3D hydrogel structures, it is still challenging to fabricate complex 3D hydrogel constructs. Inspired by the capillary origami phenomenon where surface tension of a droplet on an elastic membrane can induce spontaneous folding of the membrane into 3D structures along with droplet evaporation, a facile strategy is established for the fabrication of complex 3D hydrogel constructs with programmable shapes and sizes by crosslinking hydrogels during the folding process. A mathematical model is further proposed to predict the temporal structure evolution of the folded 3D hydrogel constructs. Using this model, precise control is achieved over the 3D shapes (e.g., pyramid, pentahedron, and cube) and sizes (ranging from hundreds of micrometers to millimeters) through tuning membrane shape, dimensionless parameter of the process (elastocapillary number Ce ), and evaporation time. This work would be favorable to multiple areas, such as flexible electronics, tissue regeneration, and drug delivery.