Three organic compounds (i1, i2, and i3) were tested for their ability to inhibit corrosion on carbon steel in both saline (3.5 wt. % NaCl) and acidic (0.5 M H2SO4) solutions. Multiple techniques, including potentiodynamic polarization, electrochemical impedance spectroscopy, and scanning electron microscopy, were employed to evaluate corrosion behavior. All three inhibitors demonstrated positive effects, shifting the open-circuit potential to more positive values and reducing corrosion current density. However, i3 consistently outperformed i1 and i2, particularly in the acidic environment. At a concentration of 2.0 mM, i3 achieved maximum inhibition efficiencies of 97.6 % and 99.7 % in NaCl and H2SO4 solutions, respectively. Electrochemical impedance spectroscopy further confirmed the superior performance of i3, with higher impedance values and increased corrosion resistance at higher concentrations. Adsorption studies revealed that i3 followed the Langmuir adsorption isotherm in the acidic solution, indicating strong adsorption to the metal surface. Scanning electron microscopy visualized the significant reduction in corrosion damage caused by the inhibitors, especially i3. However, i2 showed decreased stability over time, leading to reduced inhibition. Molecular dynamics simulations provided insights into the adsorption behavior of the inhibitors. i3 exhibited stronger bonding with the iron surface in the acidic environment, contributing to its superior performance. In conclusion, i3 emerged as the most effective inhibitor for carbon steel in both saline and acidic solutions. Its strong adsorption, high inhibition efficiency, and sustained performance make it a promising candidate for corrosion protection applications.