The performance of 1-vinyl-3-allyl imidazolium bromide ([VAIM] [Br]) for inhibiting the corrosion of carbon steel in 1 M HCl solution from 298 K to 338 K was assessed. Electrochemical impedance spectroscopy (EIS) measurements proved that the inhibition efficiency (η) of [VAIM][Br] was as high as 95 %, and after immersion of 144 h, η still kept more than 90 %. Polarization curve verified that [VAIM][Br] acted as a mixed-type inhibitor and adsorption of [VAIM][Br] was found to obey Langmuir adsorption isotherm. Molecular dynamic simulations suggested that the addition of vinyl group increased interaction energy between [VAIM] + and (0 0 1) plane of Fe from 43.92 kcal mol À 1 to 71.98 kcal mol À 1. Liquid chromatographymass spectrometry (LC-MS) and UV-vis spectrum demonstrated that [VAIM][Br] and Fe atom can form stable complex (Fe 2 (VAIM) 2 Br 4), which hindered the corrosion of carbon steel.