Chitosan as a natural polymer has gained considerable attention in recent years due to its organic nature and unique chemical properties. In this study, chitosan extracted from prawn shells was studied as a green corrosion inhibitor in saline solution (3.5% NaCl) under different temperature conditions, 298 K, 303 K and 308K, and different saline solution concentration ranges of pH 6.5, 7.5, and 8.5. The prepared chitosan was characterized by Fourier Transform Infrared Spectroscopy (FTIR) and X-ray diffraction (XRD). Electrochemical studies (potentiodynamic polarization) were performed to study the corrosion rate (CR) and the inhibition efficiency (%IE). The metal surface was studied using Scanning Electron Microscopy (SEM) and X-ray Fluorescence (XRF) in order to determine the adsorption capacity of the inhibitor and confirm that a protective barrier was formed that protected the mild steel from rapid corrosion. Quantum simulations were carried out through density functional theory (DFT) using the Gaussian 09 program. Molecular dynamics was performed in Material studio software (2020) using the Forcite module and applying the COMPASS forcefield simulation, to study the interaction of the inhibitor with the metal surface at different temperatures, and therefore calculate the interaction energy. The study shows that an increase in temperature tends to speed up the corrosion rate, and an increase in the inhibitor amount shows a decline in the overall corrosion rate.