Three cationic polyurethane surfactants (LC1–1, LC2–2, and LC2–3), each featuring different hydrophobic structures, were synthesized using isophorone diisocyanate, N-methyl diethanolamine, 1-bromohexadecane, and 1-bromobutane. The synthesized cationic polyurethane surfactants exhibited low surface tension, excellent foaming properties, and resistance to salt, attributed to steric hindrance among long-chain alkyl groups and their “multi-point anchoring” ability. The corrosion inhibition performance of polyurethane surfactants on carbon steel in 1 M HCl solution was evalutated, and LC2–2 showing a considerable corrosion inhibition efficiency of 97.0 %. This film effectively reduced/isolated contact between the corrosive solution and the steel interface. Furthermore, quantum chemical calculations corroborated the electrochemistry experiment results, affirming that the molecular structure of LC2–2 is particularly conducive to inhibiting the corrosion of carbon steel. This study explores the relationship between the molecular structure of surfactants and its impact on both surface activity and corrosion inhibition efficiency.