The electrocatalytic performance of nanomaterials can be enhanced by finetuning the coordination environment and number of low-coordination atoms. Confinement engineering is the most effective strategy for the precise chemical synthesis of electrocatalysts through the modulation of electron transfer properties, atomic arrangement, and molecular structure in a confined region. It not only alters the coordination environments to adjust the formation mechanism of active centers, but also regulates the physicochemical properties of electrocatalysts. Consequently, the nucleation, transportation, and stabilization of intermediate species in electrocatalysis are optimized, and then improve the performance covering activity, stability, and selectivity. In this review, confinement engineering is introduced in terms of confined definition, classification, construction, and basic principles. Then, the latest advances in the confinement engineering of electrocatalysts for the oxygen reduction reaction, hydrogen evolution reaction, oxygen evolution reaction, nitrogen reduction reaction, and carbon dioxide reduction reaction are systematically evaluated. Furthermore, using representative experimental results and theoretical calculations, the structure-activity relationships between confinement engineering and electrocatalytic performance are illustrated. Finally, potential challenges and future development prospects of confined electrocatalysts are highlighted, with a focus on controlling the construction of confined environments, investigating uncommon catalytic properties in confined regions, and practical applications.