The adsorption mechanism and inhibition performance of two pyrimidine derivatives 6-methyl-4- phenyl-4,5-dihydropyrimidine-2-thiol (THPT1) and 4,6-diphenyl 4,5-dihydropyrimidine-2-thiol (THPT2) were investigated as corrosion inhibitors using Density functional theory (DFT) at the B3LYP/6-31G(d,p) basis set level. The result showed that the theoretically calculated order of IE was found to be in close agreement with the experimental order. The calculated quantum chemical parameters correlated to the inhibition efficiency are EHOMO (highest occupied molecular orbital energy), ELUMO (lowest unoccupied molecular orbital energy), the energy gap(ΔE), hardness(η), Softness(S), dipole moment(μ), electron affinity(EA), ionization potential(IE), the absolute electronegativity (χ) and the fraction of electron transferred (ΔN). The local reactivity has been analyzed through the condensed Fukui function and condensed softness indices in order to compare the possible sites for nucleophilic and electrophilic attacks.