This study investigates the corrosion inhibition effectiveness of Dryopteris filix-mas L. (DFM) extract for A210Gr carbon steel in a 3 % NaCl solution. The DFM ethanolic extract was successfully prepared and comprehensively characterized using a combination of spectroscopic and physicochemical techniques, including HPLC, FTIR, and NMR (1H and 13C). These analyses confirmed the presence of key phenolic compounds, with Quercetin-3-O-diglucoside (Q3ODG) being the major component, comprising 82.14 % peak area as identified by HPLC. The extract, obtained via an economical ethanol extraction method, exhibited a maximum inhibition efficiency up to 88 % at a concentration of 400 ppm, as determined through electrochemical impedance spectroscopy (EIS), open circuit potential (OCP), potentiodynamic polarization (PDP), and weight loss measurements. Temperature studies revealed a drop in efficiency to 70.14 % at 323 K, indicating a temperature-sensitive inhibition mechanism. Extended immersion times led to a slight decrease in efficiency due to partial desorption, though significant protection remained after 72 h. The primary corrosion inhibition mechanism was determined to be physisorption, following the Langmuir isotherm model, with a ΔGads0 value of − 24.02 kJ/mol, indicating a spontaneous adsorption process. Thermodynamic analysis revealed an increase in Ea from 22.11 kJ/mol (blank) to 56.61 kJ/mol (400 ppm), confirming the formation of a strong protective barrier. Surface characterization techniques, including FTIR, XRD, SEM, and AFM, further confirmed the presence of a protective film rich in polar organic compounds. Complementary Density Functional Theory (DFT) and Quantum Theory of Atoms in Molecules (QTAIM) studies provided detailed insights into the molecular interactions, highlighting the key role of hydrogen bonding and van der Waals forces in the adsorption of Q3ODG onto the steel surface. These findings underscore the potential of DFM extract as an effective and sustainable corrosion inhibitor, advancing the application of biocompounds in corrosion control and encouraging further exploration of their industrial applications and environmental benefits.