Capillary folding is the process of folding planar objects into three-dimensional (3-D) structures using capillary force. It has many important industrial applications, e.g. the fabrication of microelectromechanical systems. In this work, we propose a 3-D model for the capillary folding of thin elastic sheets with pinned contact lines. The energy of the system consists of interfacial energies between the different phases and the elastic energy of the sheet. The latter is described by the nonlinear Koiter's model, which can accommodate large deformations of the sheet. From the energy, we derive the governing equations for the static system using a variational approach. We then develop a numerical method to find equilibrium solutions via a relaxation dynamics. At each time step, we evolve the sheet by using the subdivision element method, and update the droplet surface by minimizing a squared area functional using linear finite elements. Qualitatively, numerical solutions for the equilibrium configurations of the sheet–droplet system agree well with those observed in experiments. Furthermore, we identify the critical bendabilities and present bifurcation diagrams for the folding of a triangular sheet. The results exhibit rich and fully 3-D behaviours that were not captured by previous two-dimensional models. Our results provide new insights into the nonlinear process of capillary folding, and may contribute to the advancement of microfabrication techniques.