In the pickling industry, corrosion can deteriorate the quality of equipment and supplies, causing financial losses and safety threats. Therefore, it has become crucial to develop novel corrosion inhibitors that are bioactive, efficient, affordable, medium-acid soluble, and ecologically safe to protect mild steel during industrial cleaning. In this work, three newly synthesized imidazo[1,2-a]pyridine derivatives were characterized by various spectroscopic techniques. The studied compounds were evaluated as corrosion inhibitors for mild steel in 1 M HCl medium using weight-loss, potentiodynamic polarization (PDP) and electrochemical impedance spectroscopy (EIS) techniques. The imidazopyridine derivatives showed excellent anticorrosion performance, their inhibitory efficiencies increased with the increase of inhibitors concentration and evolved in the following order: Imd2 (98.1%) >Imd1 (96.5%) >Imd3 (95.3%). This order was justified by the presence of two chlorine atoms in the ortho position of the Imd2 structure. The three Imd derivatives obeyed to the Langmuir isotherm, this explained the formation of an organic monolayer on the steel surface indicated by the scanning electron microscope (SEM) and the atomic force microscope (AFM). In addition, density functional theory (DFT) and molecular dynamics (MD) simulations were performed to reveal the anticorrosion mechanism. The present study illustrates at the microscopic level how mild steel resists corrosion and ensures the safety of pickling.