Two-dimensional (2D) superconductors with excellent crystallinity down to the monolayer have many unusual properties absent in the three-dimensional (3D) bulk, such as continuous phase transition, quantum metallic state and localization of electrons. Preparation of 2D superconductors has been challenging, owing to poor quality and extreme sensitivity to air exposure at ultralow thickness, but exfoliation methods have recently been developed to achieve perfectly crystallized ultrathin superconductors. The electric-double-layer transistor and ionic field-effect transistor are powerful electric-field gating strategies for modulating the carrier concentration of ultrathin materials, which can be up to 100 times those of conventional techniques limited by high-temperature phase separation and low voltage windows. Therefore, electric-field gating of 2D superconductors has become an essential way to find new high-temperature superconductors and investigate new quantum phenomena. This Technical Review summarizes recent advances in electric-field-gated superconductivity in various ultrathin superconducting materials, including iron-based superconductors, transition-metal dichalcogenides, honeycomb bilayer superconductors and cuprates. We also offer a perspective on open challenges and future development paths in this field.