Mono Mannich base (MPE) and double Mannich base (DMPE) were synthesized from raw materials such as 4-methylacetophenone, formaldehyde and n-hexylamine, so as to investigate the corrosion inhibition and electrochemical properties of the two Mannich bases on N80 test pieces in acidic media. The corrosion inhibition efficiency of the two Mannich bases was measured by mass loss experiment. The results show that the corrosion inhibition of N80 test pieces by DMPE is better than by MPE. DMPE can decrease the corrosion current density on the surface of N80 test pieces, thus leading to a significant increase in the charge transfer resistance and effectively inhibiting the electrode reaction process of N80 test pieces. Density functional theory (DFT) of quantum chemistry was used to calculate the highest occupied molecular orbital energy level (EHOMO), the lowest unoccupied molecular orbital energy level (ELUMO), Hirshfeld charge, the condensed Fukui index and the molecular van der Waals surface minimal electrostatic potential (Vs,min) of the two Mannich bases. The results show that the highest occupied orbital energy level, DMPE is higher than MPE; and the lowest unoccupied orbital energy level, DMPE is lower than MPE. Compared with MPE, DMPE is easier to accept and give electronics. The Vs,min of DMPE is lower than that of MPE, and DMPE is more likely to ionize to form protonated quaternary ammonium salts. The 4-methylbenzene ring of DMPE, two oxygen atoms of β-carbonyl group and N atom of tertiary amine can form bonding with the frontier orbital of Fe atom of N80 test pieces. Six adsorption models of MPE and DMPE on different crystalline surfaces of Fe were constructed using the molecular dynamics simulation method. The molecular dynamics simulations results show that the absolute values of the adsorption energies of MPE and DMPE on the different Fe crystal planes are in the descending order of Fe(110), Fe(100), Fe(111); the absolute values of adsorption energy of DMPE on the same Fe crystalline surface are greater than those of MPE, indicating that DMPE is more stable than MPE during adsorption on Fe surface. © 2023 Science Press. All rights reserved.