The anti-corrosion performance of triethanolamine with Mg alloy in 3.5 wt% NaCl solution has been studied by immersion experiment, electrochemical impedance spectroscopy, potentiodynamic polarization, surface analysis, and quantum chemical methods.