A series of 4-ferrcenylbutyl carboxylate esters with different alkyl chain length (C2-C4) of carboxylic acids were synthesized using Fe3O4@SiO2@(CH2)3-Im-bisEthylFc[I] nanoparticles as catalyst and have been characterized with FT-IR, 1H NMR, and 13C NMR. Ferrocenyl-based esters were used as corrosion inhibitors of mild steel in the 1M HCl solution as corrosive media. The corrosion inhibition efficiency of the synthesized ferrocenyl-based esters has been assessed by electrochemical impedance spectroscopy (EIS), potentiodynamic polarization (PDP), atomic force microscopy (AFM), and scanning electron microscopy (SEM). The 4-ferrocenylbutyl propionate showed a more effective corrosion inhibition behavior among the studied esters with 96% efficiency after immersion in the corrosive media for 2 weeks. The corrosion inhibition mechanism is dominated by formation of passive layer of inhibitor on the surface of the mild steel by adsorption. Moreover, the adsorption characteristics of 4-butylferrcenyl carboxylate esters on mild steel were thoroughly explored using density functional theory calculations. It was found that the Fe atoms located around the C impurity in the mild steel are the most efficient and active sites to adsorb 4-butylferrcenyl carboxylate esters.