Developing transition-metal nanocatalysts with precious-metal-like ability is essential for complete mineralization of formaldehyde (HCHO) at room temperature. Herein, a series of N-doped carbon encased metallic Co (Co@NC-x) nanocatalysts have been fabricated to explore the effect of the Co particle size on HCHO oxidation for the first time. High-angle annular dark-field scanning transmission electron microscopy displayed the small-sized and highly dispersed Co nanoparticles that were formed in Co@NC-0.25, which exhibited the highest specific catalytic activity (0.594 μmolCO2·gCo–1·s–1) compared with its counterparts. Zero-valence cobalt was dominant in Co nanoparticles as revealed by X-ray photoelectron spectroscopy. Density functional theory calculations demonstrated an evident charge transfer occurring from the metallic Co core to the carbon layer. Moreover, O2 binds to the carbon site adjacent to the nitrogen atom in an end-on fashion, and the length of the O–O bond is elongated. These results revealed that the special Co@NC structure could supply an electron-rich surface, facilitating adsorption and activation of O2. Based on the identification of reaction intermediates and the microstructure of Co@NC-x, the conversion mechanism of HCHO over the as-prepared Co@NC-x was proposed. This study provides a new insight into indoor HCHO purification using transition-metal nanocatalysts with a similar efficiency as precious metals.