Phytocasin is a group of phytoalexin compounds that are synthesized and accumulate in plant cells after microbial infection. In this study, the Gaussian 16 W program package with the density functional theory (DFT) calculation method and the B3LYP/6-31G basis sets were used. The inhibitor molecules used were phytocasin A, B, C, D and E, differences in the positions of the hydroxyl (-OH) and carbonyl (C=O) groups in ring A. The analysis was carried out in the gas phase and water solvent. The results of quantum parameter calculations revealed that phytocasin has favorable electronic characteristics as an inhibitor, such as a relatively small band gap, low ionization potential, low electronegativity, indicating strong electron donation, low chemical hardness and high softness, increasing its surface reactivity. Electron transfer confirms the efficiency of charge exchange with Fe, supported by strong energy interaction and low back-donation transfer. Molecular electrostatic potential (ESP) analysis revealed carbonyl and hydroxyl groups as the dominant adsorption centers because of the highly electronegative region. The results of the calculations of bond energy, bond length and thermodynamic parameters indicate that phytocasin strongly and spontaneously interacts with Fe. These findings indicate that phytocasin is a beneficial natural iron corrosion inhibitor. The best phytocasin with potential as an iron corrosion inhibitor in the gas phase is phytocasin E, and in aqueous solvents, it is phytocasin B. The inhibitory reactivity of phytocasin in solvents is greater than that in the gas phase.