The adsorption of formyl fluoride (HFCO) and carbonyl fluoride (COF 2 ) molecules on Ni-doped and Ni-decorated single-walled carbon nanotubes (SWCNTs) was investigated using plane-wave density functional theory (DFT). All structures were optimized both before and after gas adsorption, and key properties such as adsorption energies, magnetization, and electronic characteristics including band structures and partial density of states were calculated for the optimized configurations. The maximum negative adsorption energy was observed for the Ni-decorated SWCNT, ranging from -0.90 to -1.10 eV. The results indicate that adsorption strongly depends on the orientation of the gas molecules relative to the Ni-doped SWCNT. Notably, the electronic properties of the Ni-doped SWCNT revealed that it retains its metallic character across all adsorption configurations. Additionally, adsorption on the Ni-decorated SWCNT enhanced both its magnetization and electronic properties. These findings suggest that Ni-modified SWCNTs hold significant potential as candidates for detecting HFCO and COF 2 gases. • HFCO and COF 2 show orientation-dependent adsorption on Ni-doped SWCNTs. • Ni-doped SWCNTs retain metallic character after gas molecule adsorption. • Ni-decorated SWCNTs show highest adsorption energy, indicating strong binding. • Ni-decorated SWCNTs switch from semiconducting to metallic upon gas adsorption. • COF 2 induces magnetization in Ni-decorated SWCNTs, enhancing spintronic potential.