Omeprazole (OL) as a green and efficient drug corrosion inhibitor was first investigated for the corrosion inhibition of Q235 carbon steel at 298, 308, and 318 K. Open circuit potential, Tafel, electrochemical impedance spectroscopy, and weight loss were used to evaluate the inhibition performance toward Q235 carbon steel in HCl medium. The results showed that OL exhibited excellent corrosion protection to carbon steel at different temperatures because of forming the compact and ordered OL adsorption film on Q235 surface. Especially, the inhibition efficiency increased to 96.11%, 95.12%, and 94.04% for 40-mg/L OL in Tafel at 298, 308, and 318 K. Meanwhile, N-Fe and S-Fe bonds determined from X-ray photoelectron spectroscopy revealed the multiple anchoring interactions between steel and OL with S and N atoms as the active sites. Density functional theory and molecular dynamics simulations showed the low energy gap ΔE and high adsorption energy values, besides the radial distribution function (RDF) indicating the strong chemical sorption of OL on Fe surface, which proved the superior corrosion inhibition efficiency of OL at a molecular or atomic level.