The inhibition of mild steel corrosion in 1 M HCl solution by some ionic liquids (ILs) namely, 1-hexyl-3-methylimidazolium trifluoromethanesulfonate [HMIM][TfO], 1-hexyl-3-methylimidazolium tetrafluoroborate [HMIM][BF4], 1-hexyl-3-methylimidazolium hexafluorophosphate [HMIM][PF6], and 1-hexyl-3-methylimidazolium iodide [HMIM][I] was investigated using electrochemical measurements, spectroscopic analyses and quantum chemical calculations. All the ILs showed appreciably high inhibition efficiency. At 303 K, the results of electrochemical measurements indicated that the studied ILs are mixed-type inhibitors. The adsorption studies showed that all the four ILs adsorb spontaneously on steel surface with [HMIM][TfO], [HMIM][BF4] and [HMIM][I] obeying Langmuir adsorption isotherm, while [HMIM][PF6] conformed better with Temkin adsorption isotherm. Spectroscopic analyses suggested the formation of Fe/ILs complexes. Some quantum chemical parameters were calculated to corroborate experimental results.