The corrosion inhibition properties of 2-(1,3,4-thiadiazole-2-yl)pyrrolidine (2-TP) on mild steel in a 1 M HCl solution were investigated using weight loss, potentiodynamic polarization, electrochemical impedance spectroscopy (EIS) and open circuit potential (OCP) measurements. In addition, DFT calculations were performed on 2-TP. The polarization curves revealed that 2-TP is a mixed-type inhibitor. The results indicate that 2-TP is an effective inhibitor for mild steel corrosion in a 1.0 M HCl solution, with an inhibition efficiency of 94.6% at 0.5 mM 2-TP. The study also examined the impact of temperature, revealing that the inhibition efficiency increases with an increasing concentration of 2-TP and decreases with a rise in temperature. The adsorption of the inhibitor on the mild steel surface followed the Langmuir adsorption isotherm, and the free energy value indicated that the adsorption of 2-TP is a spontaneous process that involves both physical and chemical adsorption mechanisms. The DFT calculations showed that the adsorption of 2-TP on the mild steel surface is mainly through the interaction of the lone pair of electrons on the nitrogen atom of the thiadiazole ring with the metal surface. The results obtained from the weight loss, potentiodynamic polarization, EIS and OCP measurements were in good agreement with each other and confirmed the effectiveness of 2-TP as a corrosion inhibitor for mild steel in 1.0 M HCl solution. Overall, the study demonstrates the potential use of 2-TP as a corrosion inhibitor in acid environments.