ontrolling the magnetic state of devices by electrical means is critical for spin-based data storage and logic 1,2 . One of the key technological challenges is to achieve efficient 180° magnetic switching by electrical means. Current methods are mostly based on local magnetic fields or spin torques 3,4 . Due to a much lower energy consumption 5,6 , voltage-controlled magnetization switching is desirable. However, it is inherently difficult because electric fields do not induce the required time-reversal symmetry breaking for 180° magnetic switching. Many methods, such as using piezoelectric and multiferroic materials 5,[7][8][9][10][11] , are being explored for voltage-controlled magnetization switching. However, these methods involve either high voltages for inducing enough strain, or difficult fabrication procedures.Multi-sublattice materials present unique opportunities for voltage control of magnetism 12,13 , with ferrimagnets being promising for achieving 180° switching owing to their multi-sublattice configuration with magnetic moments of different magnitudes opposing each other. By tuning the relative sublattice magnetization magnitudes, the net magnetization can be reversed. Moreover, compared with ferromagnets, ferrimagnets offer technological advantages as they allow for small spin textures 14 , fast spin dynamics [14][15][16] and ultrafast optical switching 17 . However, the conventional approaches to controlling the compensation of ferrimagnets, such as varying the composition at fabrication 18 , annealing 19,20 , heating or cooling 21 and hydrogen gas exposure 22,23 , do not allow for localized electrical actuation. Ultrashort light pulses have been shown to enable all-optical switching of ferrimagnets 17,24,25 , however, the need for an ultrafast laser source may complicate device designs and the optical paths may be difficult to scale.Here, we show the reversible control of the dominant sublattice of a rare earth-transition metal (RE-TM) alloy ferrimagnet (GdCo) by a gate voltage (V G ) using a solid-state hydrogen pump 26 . The control originates from the injection of hydrogen, sourced from ambient moisture through hydrolysis, into GdCo, which tunes the relative sublattice magnetizations and hence the degree of compensation. By applying a small V G , the compensation temperature (T M ) can be shifted by >100 K, and the dominant sublattice can be reversibly switched under ambient, isothermal conditions. Element-specific X-ray magnetic circular dichroism (XMCD) revealed that hydrogenation reduces the sublattice magnetization of Gd substantially, but only modestly reduces that of Co. Mean-field modelling of the experimental data combined with ab initio calculations suggest that this results from hydrogen-induced reduction of the inter-sublattice exchange coupling strength that is largely responsible for the Gd sublattice order. We demonstrate here that the dominant sublattice can be toggled using pulses as short as 50 μs at room temperature, and that the devices show no degradation after >10 4 gatin...