The inhibition and the effect of temperature and concentration of trans-4-hydroxy-4′-stilbazole on the corrosion of mild steel in 1 M HCl solution was investigated by weight loss experiments at temperatures ranging from 303 to 343 K. The studied inhibitor concentrations were between 1 × 10 − 7 M and 1 × 10 − 3 M. The percentage inhibition increased with the increase of the concentration of the inhibitor. The percentage inhibition reached about 94% at the concentration of 1 × 10 − 3 M and 303 K. On the other hand, the percentage inhibition decreased with the increase of temperature. Using the Temkin adsorption isotherm, the thermodynamic parameters for the adsorption of this inhibitor on the metal surface were calculated. Trans-4-hydroxy-4′-stilbazole was found to be a potential corrosion inhibitor since it contained not only nitrogen and oxygen, but also phenyl and pyridine rings that are joined together with a double bond (–C=C–) in conjugation with these rings.