Harvesting oxygen and metals from the local resources of the Moon is a key step to advancing outer space exploration. A large amount of oxygen is stored in the lunar regolith in the form of oxides. Many efforts have been devoted to electrochemically splitting oxides to oxygen and metals in molten oxides and molten salts. However, a cheap oxygen-evolution inert anode is still a serious challenge, especially in the supercorrosive molten halides. Herein, we combine a molten CaCl 2 electrolyzer that can convert Chang'e-5 lunar regolith simulants to metals and CO 2 using a carbon anode and a molten carbonate electrolyzer that can convert the generated CO 2 to carbon and oxygen using a cheap Ni11Fe10Cu oxygen-evolution anode. Further, the electrolytic carbon is reused as the anode in the molten CaCl 2 electrolyzer, thereby closing the carbon cycle. Hence, the overall electrochemical reaction of the dual-electrolyzer system is to convert lunar regolith to metals and oxygen. More broadly, this system can convert the CO 2 generated by humans living on the Moon and Mars to oxygen and carbon materials.