An imidazolium-based ionic liquid, i.e., 1-Hexadecyl-3-methylimidazolium Bromide (HMIBr), was investigated as a corrosion inhibitor candidate for mild steel in 1 M HCl medium using combined electrochemical and molecular simulation methods. Potentiodynamic polarization results show that HMIBr is a mixed-type inhibitor and suppresses the corrosion process effectively at optimum concentration 10(-3) M with 96.9% inhibition efficiency. Electrochemical impedance spectroscopy (EIS) analysis indicated an increase in the charge transfer resistance with enhance of inhibitor concentration, and confirmed the adsorption of HMIBr on the iron surface. Moreover, density functional theory (DFT) calculations, Monte Carlo as well as molecular dynamics simulations were employed to obtain further insights into the antiseptic mechanism. Our findings have important guiding significance for understanding the corrosion inhibition mechanism and designing new ionic liquid-based inhibitor molecules.