There is a growing trend in utilizing plant extracts and pharmaceutical compounds as corrosion inhibitors. Accurate identification of the essential oil of aerial parts of Pelargonium was obtained using hydrodistillation, gas chromatography and gas chromatography–mass spectrometry. The oil was predominated by citronellol (22.8 %). The inhibitory effect of essential oil and extract of Pelargonium was estimated on the corrosion of mild steel in 1 M hydrochloric acid (HCl) using weight loss, electrochemical impedance spectroscopy (EIS) and Tafel polarization curves. Inhibition was found to increase with increasing concentration of the essential oil and extract of Pelargonium. The effect of temperature on the corrosion behavior of mild steel in 1 M HCl with addition of essential oil and extract was also studied, and the thermodynamic parameters were determined and discussed. Values of inhibition efficiency were calculated from weight loss, Tafel polarization curves, and EIS. All results are in good agreement. Polarization curves showed that essential oil and extract of Pelargonium behave as mixed type inhibitors in HCl (1 M). The results obtained showed that the essential oil and extract of Pelargonium could serve as an effective inhibitor of the corrosion of mild steel in HCl solution. To avoid any unexpected toxicity, the majority of compounds have been studied by using POM analyses.