To be successfully implemented, an efficient conversion, affordable operation and high values of CO 2 -derived products by electrochemical conversion of CO 2 are yet to be addressed. Inspired by the natural CaO-CaCO 3 cycle, we herein introduce CaO into electrolysis of SnO 2 in affordable molten CaCl 2 -NaCl to establish an in situ capture and conversion of CO 2 . In situ capture of anodic CO 2 from graphite anode by the added CaO generates CaCO 3 . The consequent coelectrolysis of SnO 2 and CaCO 3 confines Sn in carbon nanotube (Sn@CNT) in cathode and increases current efficiency of O 2 evolution in graphite anode to 71.9 %. The intermediated CaC 2 is verified as the nuclei to direct a self-template generation of CNT, ensuring a CO 2 -CNT current efficiency and energy efficiency of 85.1 % and 44.8 %, respectively. The Sn@CNT integrates confined responses of Sn cores to external electrochemical or thermal stimuli with robust CNT sheaths, resulting in excellent Li storage performance and intriguing application as nanothermometer. The versatility of the molten salt electrolysis of CO 2 in Ca-based molten salts for template-free generation of advanced carbon materials is evidenced by the successful generation of pure CNT, Zn@CNT and Fe@CNT.