Six corrosion inhibitors based on dimeric quaternary ammonium salts (gemini surfactants) with a flexible/rigid spacer have been tested for stainless steel in 3 M HCl. Potentiodynamic polarization (linear polarization resistance, Tafel slopes) and electrochemical impedance spectroscopy have been used to determine the corrosion inhibition efficiency of the compounds. The results suggest that inhibitors act as anodic/cathodic inhibitors. The highest corrosion inhibition efficiency has been reached around the values of the critical micellar concentration for each inhibitor. Scanning electron microscopy has been applied to study the surface of the stainless steel samples. Theoretical studies of the inhibitors have been run based on density functional theory.