PurposeThe main purpose of the present work is to introduce two new Schiff bases as corrosion inhibitors (CIs) for carbon steel (CS). The anti-corrosion performance of these Schiff bases having N and S heteroatoms in their structures was investigated and compared in 2 M HCl electrolyte. The inhibitory activity of these Schiff bases was also assessed.Design/methodology/approachCommon electrochemical assays like potentiodynamic polarization and electrochemical impedance measurements were used to evaluate the ability of compounds in reduction of the rate of corrosion. Quantum chemical calculations (QCCs) were also used to examine the corrosion inhibitive and the process related to the electrical and structural characteristics of the molecules acting as CIs.FindingsThe electrochemical measurements indicate that both Schiff bases acted as the efficient CIs of CS in 2 M HCl electrolyte. The adsorption of the Schiff base on the surface of the CS caused the corrosion to be inhibited. The change of Gibbs energies indicated that both physical and chemical interactions are involved in the adsorption of NNS and SNS on CS surfaces. The predicted QCCs of the CIs neutral and positively charged versions were well-aligned with those obtained by electrochemical experiments.Originality/valueUsing electrochemical experiments and quantum chemical modelings, two new Schiff bases, N-2-((2-nitrophenyl)thio)phenyl)-1-(pyrrole-2-yl)methanimine (NNS) and N-2-((2-nitrophenyl)thio)phenyl)-1-(thiophen-2-yl)methanimine (SNS), were evaluated as anti-corrosion agents for CS in 2 M HCl electrolyte. The DFT calculations were considered to compute the quantum chemical parameters of the inhibitors.