Here in, cationic surfactants namely (1-octyl, decyl, and dodecyl-4-mercaptopyridine-1-ium bromide) I, II and III, respectively, were synthesized. The inhibition effect of these surfactants on the corrosion of carbon steel in 1 M HCl was studied by polarization, electrochemical impedance spectroscopy (EIS) and weight loss measurements. Polarization curves revealed that the used inhibitors represent mixed-type inhibitors. Adsorption of used inhibitors led to a reduction in the double layer capacitance and an increase in the charge transfer resistance. Adsorption of used compounds was found to obey Langmuir isotherm.