The present work aimed to investigate the corrosion behaviour of carbon steel (CS) in hydrochloric acid and sulfuric acid solutions (1 MHCl and 0.5 M H2SO4) in the presence of new macromolecular epoxy resin synthesized namely N2.N4.N6-tris(2-(oxiran-2-yl methoxy) ethyl)-N2.N4.N6-tris(oxiran-2-yl methyl)-2. 4.6-triamine-1.3.5-triazine (ERT). This corrosion protection activity was detected by utilizing various methods including electrochemical impedance spectroscopy (EIS), polarisation curve (PC) measurements, atomic force microscope (AFM) analysis, global quantum chemical descriptors computations (GQCDs) and molecular dynamics (MDs) simulation. The corrosive solutions after corrosion tests have been identified by UV-visible. The obtained results, indicating that the compound as mixed type inhibitor significantly reduced the corrosion rate of CS due to the formation of a stable protective film on the metal surface. As confirmed by EIS, AFM and theoretical studies, chemically adsorbed ERT molecule is a better corrosion inhibitor with higher corrosion efficacy of about 95.5% in HCl and 98% in H2SO4 at room temperature. Langmuir isotherm model is the most acceptable one to describe the ERT molecules adsorption on the surface of CS. Protection mechanisms were supported by GQCDs, Fukui functions, dual local descriptors, radial distribution function and MDs simulation. These theoretical calculations support the results obtained experimentally to qualify ERT as a very effective inhibitor against the corrosion of CS in both acidic media. (C) 2021 Elsevier B.V. All rights reserved.