Three gemini cationic surfactants with different hydrophobic spacer chain lengths were synthesized and characterized. The inhibition effect of N,N′-bis(2-hydroxyethyl)-N,N′-dimethyl-N,N′-bis(2-(tetradecanoyloxy)ethyl)ethane-1,2-diaminium bromide (G-2); N,N′-bis(2-hydroxyethyl)-N,N′-dimethyl-N,N′-bis(2-(tetradecanoyloxy)ethyl) hexane-1,6-diaminium bromide (G-6); and N,N′-bis(2-hydroxyethyl)-N,N′-dimethyl-N,N′-bis (2-(tetradecanoyloxy) ethyl) dodecane-1,12-diaminium bromide (G-12) on the corrosion of carbon steel in 1.0 M HCl solution at 25–60 °C was studied by weight loss, potentiodynamic polarization, and electrochemical impedance spectroscopy. The results show that the synthesized inhibitors are effective inhibitors even at very low concentration, and the adsorption on the carbon steel surface obeys the Langmuir adsorption isotherm. Potentiodynamic polarization curves reveal that the synthesized inhibitors behave as a mixed-type inhibitor. Adsorption of used inhibitors led to a reduction in the double layer capacitance and an increase in the charge transfer resistance. Thermodynamic parameters have been obtained by adsorption theory. Surface activity and corrosion inhibition relationship were discussed. The biodegradability of the synthesized surfactants showed their readily biodegradation in the open environment and were considered as environmentally friendly corrosion inhibitors.