In this paper, two novel organic inhibitors, TAP-TPP and TAP-CEQ, were prepared via Schiff base condensation as a green chemistry methodology using an eco-friendly catalyst, ceric ammonium nitrate, with a high yield (87% and 91%), and characterized via elemental analysis, FTIR, 1H, and 13C NMR spectroscopic analysis tools. Weight loss assessment was utilized as a chemical testing method, and the maximum inhibition efficiency of TAP-TPP and TAP-CEQ is 89.4% and 91.8%, respectively. PDP and EIS were electrochemical measures to determine the efficacy of both inhibitors as anticorrosion for carbon steel alloys in 2 M HCl aggressive media. The collected electrochemical results demonstrated that both inhibitors behaved as excellent anticorrosion agents for metallic constructions. According to the potentiodynamic polarization (PDP) analysis, these organic inhibitors worked as mixed-type inhibitors. The adsorption isotherm revealed that undertaken compounds obeyed Langmuir adsorption isotherm with the free energies of adsorption of ranged from ΔG = − 34.29 to − 34.63 kJ Mol−1. Also, electrochemical impedance spectroscopy (EIS) data confirmed that the values charge transfer resistance (Rct) was increased by increasing the concentration of the injected inhibitor molecules. In contrast, the electrochemical double layer (Cdl) was dramatically decreased. The work was supported by two-surface analysis methods such as SEM and EDX. For more details, the values of percentage inhibition efficiency can be ordered as follows: TAP-CEQ > TAP-TPP. Finally, a suitable inhibition mechanism and theoretical studies including EHOMO, ELUMO, diploe moment (µ), and electrophilicity index (ω) were assumed and discussed in detailed.