In this research, the efficiency of two Schiff bases (SB-I and SB-II) as inhibitors of carbon steel corrosion in acidic medium was investigated to find the relationship between molecular structure parameters and the experimental percentage inhibition efficiencies. The computational data and experimental IE% were subjected to correlation analysis, demonstrating that the effect of the inhibitors is strongly linked to electronic properties, including the energies of frontier molecular orbitals (HOMO and LUMO energy), energy band gap (∆Egap), dipole moment ($$\mu$$ μ ), electronegativity ($$\chi$$ χ ), electron affinity (A), global hardness (η), softness (σ), ionization potential (I), fraction of electrons transferred from inhibitor molecules to metallic atoms (∆N), and total energy. In addition, we used natural bond orbital analysis to obtain the Fukui functions. The results were also investigated to estimate the significance of the nitrogen and oxygen atoms for the preventive effect. There was found to be good correlation between the theoretically obtained data and reported empirical data.