The current study examines the evaluation of diazene-based Schiff base derivatives, namely, 4-((E)-(3-((E)-(hexylimino)methyl)-4-hydroxyphenyl)diazenyl)benzonitrile (S1) and 4-((E)-(3-((E)-(dodecylimino) methyl)-4-hydroxyphenyl)diazenyl)benzonitrile (S2). The structure elucidation of prepared the Schiff base compounds was performed by FTIR, 1 H NMR, and 13C NMR. In addition, the corrosion inhibition capacity of these compounds was investigated for API X65 steel pipelines in 1 M HCl utilizing gravimetric and electrochemical methods. By conducting the experimental investigations at various doses, it was possible to assess the inhibition effectiveness and adsorption behavior of S1 and S2. With increasing concentration, both inhibitors became more effective at inhibiting corrosion. S1 and S2 suppressed both cathodic and anodic processes, as shown by the potentiodynamic polarization study. The charge transfer resistance (R ct ) increased when S1 and S2 concentrations increased, according to the electrochemical impedance analysis (EIS) data. According to the Langmuir isotherm model, the adsorption of S1 and S2 inhibitors on carbon steel was discovered based on gravimetric measurements. The results were confirmed by theoretical data in addition to the experimental tests for the presence of S1 and S2 inhibitor films over the API X65 carbon steel surface.