High-temperature superconductivity in copper oxides arises when a parent insulator compound is doped beyond some critical concentration; what exactly happens at this superconductor–insulator transition is a key open question1. The cleanest approach is to tune the carrier density using the electric field effect2, 3, 4, 5, 6, 7; for example, it was learned in this way5 that weak electron localization transforms superconducting SrTiO3 into a Fermi-glass insulator. But in the copper oxides this has been a long-standing technical challenge3, because perfect ultrathin films and huge local fields (>109 V m−1) are needed. Recently, such fields have been obtained using electrolytes or ionic liquids in the electric double-layer transistor configuration8, 9, 10. Here we report synthesis of epitaxial films of La2− xSrxCuO4 that are one unit cell thick, and fabrication of double-layer transistors. Very large fields and induced changes in surface carrier density enable shifts in the critical temperature by up to 30 K. Hundreds of resistance versus temperature and carrier density curves were recorded and shown to collapse onto a single function, as predicted for a two-dimensional superconductor–insulator transition11, 12, 13, 14. The observed critical resistance is precisely the quantum resistance for pairs, RQ = h/(2e)2 = 6.45 kΩ, suggestive of a phase transition driven by quantum phase fluctuations, and Cooper pair (de)localization.