The influence of four newly synthesized pyrimidine derivatives on the corrosion inhibition of mild steel in 0.5 M HCl solution is studied using mass loss and electrochemical techniques. The corrosion rate was found to depend on concentration and temperature of the medium. Adsorption of all the four inhibitors obeys Langmuir isotherm model. Polarization curves indicated that the studied inhibitors are of mixed type. Electrochemical impedance spectroscopy explains the mechanism of inhibitor’s action. Various activation and adsorption thermodynamic parameters were calculated and discussed. The results obtained from weight loss and electrochemical studies are in good agreement with each other. The variation in inhibitive efficiency mainly depends on the type and nature of the substituents present in the inhibitor molecule.