A facile and efficient one pot synthesis has been developed for the preparation of quinoline-substituted carbazoles 3-(4-carboxyquinolin-2-yl)-9-methyl-9H-carbazole (Cbz-QCA) and 3-(4-chloroquinolin-2-yl)-9-methyl-9H-carbazole (Cbz-ClQ) by treating 3-acetyl-9-methyl-9H-carbazole (3Ac-Cbz), with isatin under Pfitzinger reaction conditions and utilizing anthranilic acid in the presence of POCl3 through the modified Niementowski method, respectively. The synthesized compounds have been comprehensively characterized through spectral data. The effect of 3Ac-Cbz (1), Cbz-QCA (2) and Cbz-ClQ (3) were assessed as a steel corrosion inhibitor in molar hydrochloric acid using weight loss, potentiodynamic polarization, and electrochemical methods. The inhibitory effect rises with tested inhibitor concentration, reaching above 84% at higher concentrations of all tested inhibitors. These results indicated that tested inhibitors have a good corrosion inhibition. An increase in the inhibitor’s concentration leads to a higher percentage of inhibition efficiency, driven by the adsorption of inhibitor molecules onto the metal surface. Results from scanner electron microscopy (SEM) support the experimental inhibition tests have yielded successful outcomes and validate the adsorption process.