Electrochemical reduction of carbon dioxide (CO2) to fuels and value-added industrial chemicals is a promising strategy for keeping a healthy balance between energy supply and net carbon emissions. Here, the facile transformation of residual Ni particle catalysts in carbon nanotubes into thermally stable single Ni atoms with a possible NiN3 moiety is reported, surrounded with a porous N-doped carbon sheath through a one-step nanoconfined pyrolysis strategy. These structural changes are confirmed by X-ray absorption fine structure analysis and density functional theory (DFT) calculations. The dispersed Ni single atoms facilitate highly efficient electrocatalytic CO2 reduction at low overpotentials to yield CO, providing a CO faradaic efficiency exceeding 90%, turnover frequency approaching 12 000 h(-1), and metal mass activity reaching about 10 600 mA mg(-1), outperforming current state-of-the-art single atom catalysts for CO2 reduction to CO. DFT calculations suggest that the Ni@N-3 (pyrrolic) site favors *COOH formation with lower free energy than Ni@N-4, in addition to exothermic CO desorption, hence enhancing electrocatalytic CO2 conversion. This finding provides a simple, scalable, and promising route for the preparation of low-cost, abundant, and highly active single atom catalysts, benefiting future practical CO2 electrolysis.