Metal–organic frameworks (MOFs) are porous crystalline materials consisting of metal ions bound through coordination bonds to organic linkers. Much research over the last few decades have been devoted to the synthesis of these materials in view of their promising applications in, for example, catalysis, separation, gas storage, drug delivery and sensing. Among the variety of methods developed for the synthesis of MOFs are electrochemical techniques. These methods have several advantages such as mild synthesis conditions, shorter synthesis times and the possibility to control the reaction conditions directly during the synthesis process. However, the progress of electrosynthesis methods has lagged behind that of other methods such as solvothermal and microwave-assisted synthesis. In this Review, we summarise and critically assess research on the electrosynthesis of MOFs and provide a full picture of the developments within this field. The various ways in which electrochemistry has contributed to the synthesis of MOFs are explained, their strengths and shortcomings are discussed, and an outlook for future research is provided.