Present investigation describes the green corrosion inhibition and adsorption behaviour of two synthesized pyrimidine derivatives, namely, 6,6′-(1,4-phenylene)bis(4-oxo-2-thioxo-1,2,3,4-tetrahydropyrimidine-5-carbonitrile) (POTC) and 6,6′-(1,4-phenylene)bis(5-chloro pyrimidine-2,4(1 H,3 H)-dione) (PCPD) on mild steel in 15% HCl environment. The corrosion inhibition capability of the synthesised inhibitors was measured with the help of weight loss & electrochemical techniques. The corrosion inhibition efficiency measured by the weight loss experiment for the POTC and PCPD inhibitor at 200 ppm concentration & 303 K temperature was 96.9% and 93.3%, respectively. Both inhibitors obey Langmuir adsorption isotherm and mixed (physisorption as well as chemisorption) nature of adsorption because the magnitude of free energy of adsorption for both inhibitors lies in the range of − 35.99 to − 37.93 kJmol−1. The results of Tafel polarization notified that both inhibitors suppressed the rate of cathodic and anodic corrosion reactions and designated as mixed type inhibitor. The observations of FESEM, EDX, AFM, and XPS suggested the formation of protective film of inhibitor on mild steel surface. The computational investigations (DFT & MCS) well support the experimental outcomes of both inhibitors.