Pyrazole derivative Ethyl (E)-2-cyano-3-(1,3-diphenyl-1H-pyrazol-4-yl)acrylate (Pz-a) and its novel nitro derivative Ethyl (E)-2-cyano-3-(3-(3-nitrophenyl)-1-phenyl-1H-pyrazol-4-yl)acrylate (Pz-b) were synthesized and characterised using Mass spectra, IR, 1H NMR, 13C NMR and utilized to safeguard mild steel from degradation in 1 M Hydrochloric acid environment. The inhibition effectiveness and mechanism were examined through both experimental and theoretical calculations. Electrochemical analysis illustrate that the protective property of pyrazoles rises proportionally with concentration. Potentiodynamic polarization reveals, both pyrazoles exhibit characteristics of mixed type inhibitors, inhibiting both oxidation and reduction processes. Pz-a and Pz-b adhesion on mild steel surface resembles the Langmuir isotherm. Gibbs free energy of adsorption (ΔGads) indicates Pz-a and Pz-b adsorbs physically and chemically over metal surface. The inhibition efficiency was found to be 89.85 % for Pz-b and 84.47 % for Pz-a at 10−2 M concentration. AFM scanning further confirms that the inhibitors are confined over mild steel. Better understanding of the corrosion inhibition mechanism has been facilitated by theoretical investigations through DFT parameters.