Abstract The effect of 2-amino-4-methylpyridine (AMP) on the corrosion behavior of mild steel (MS) in 0.5M HCl is investigated with electrochemical methods and theoretical calculations. The electrochemical tests show that the polarization resistance of MS increasing the presence of AMP in acid solution. Adsorption of AMP on MS surface is a physical and obeys the Langmuir isotherm. The quantum parameters signaled adsorption occurs on amine and methyl substituents of AMP. The inhibition efficiency is related to frontier orbital’s energy band gap of AMP, which are 5.357 and 6.490eV for neutral and protonated molecules in aqueous solution, respectively.