In recent years, green corrosion inhibitors derived from natural plant resources have garnered much interest. In the present work, at first, we investigated the corrosion behavior of mild steel (st-37) in the presence, and absence of Dracocephalum extract based on bulk size as a corrosion inhibitor in two widely used acidic environments (0.5 M H2SO4, and 1.0 M HCl), at room temperature. Then, we used Dracocephalum extract based on nanometer size to reduce the optimal concentration of inhibitor, increase the corrosion resistant, and efficiency. Dracocephalum extract does not contain heavy metals or other toxic compounds, and also good characteristics such as low cost, eco-friendly, and widespread availability, make it suitable nature candidate as an environmentally safe green inhibitor. The anticorrosive behavior was assessed using electrochemical impedance spectroscopy (EIS), and potentiodynamic polarization (PP). In all of the studies, the inhibitory efficiency (IE%) increased as the extract dose was increased. But by using nano extract, in addition to maintaining high efficiency, the amount of inhibitor was reduced significantly. The highest IE% is 94% at the best dose of nano extract (75 ppm), but the highest IE% is 89% at the best dose of the bulk extract (200 ppm) in H2SO4 solution. Also, for the HCl solution, the highest IE% is 88% at the best dose of nano extract (100 ppm), but the highest IE% is 90% at the best dose of the bulk extract (400 ppm), by polarization method. The PP results suggest that this compound has an effect on both anodic, and cathodic processes, and that it adsorbs on mild steel surface according to the Langmuir adsorption isotherm. Optical microscopy, scanning electron microscopy (SEM) analysis, and a solid UV–Visible reflection spectrum were used to investigate the alloys' surface morphology.