Two types of carbon dots (C-Dots), N-doped and N, Si-doped, were synthesized through a hydrothermal technique and named CD1 and CD2, resp. TEM, SEM, XRD, FTIR, UV-vis spectrophotometric absorbance and photoluminescence (PL) analyses were utilized to characterize the synthesized C-Dots. The potential of CD1 and CD2 to inhibit the corrosion of mild steel (MS) in 1 mol. L-1 HCl was studied electrochem. by potentiodynamic polarization (PDP) and electrochem. impedance spectroscopy (EIS) techniques along with the complementary surface studies. Both C-Dots were quasi-spherical with nanometer-sized nucleation clusters dispersed in the liquid phase. CD2 nanoparticles showed a significant level of crystallization, while CD1 corresponded to a group of sp2 graphitic carbon with stacking faults. Similar optical properties were obtained for both synthesized C-dots with absorption in the range 200-350 nm, emission at around 420 nm and wavelength-independent emission properties. The maximum inhibition efficiency (IE%) obtained at 298 K and 200 mg L-1 for CD1 and CD2 were 91.90 % and 94.37 %, resp. The concentration of inhibitors had a direct correlation with IE, as the C-Dots were more readily adsorbed onto the MS surface, creating a protective film. The Langmuir adsorption isotherm gave the best fit compared to the kinetic thermodn. model. The type of charge on the metal surface and the chem. structure of the inhibitor impact the adhesion of the inhibitor to the surface. Addnl., chemisorption and physisorption played a critical role in the strong interaction between the synthesized C-dots and MS surface. Utilizing synthesized C-Dots is a novel, eco-friendly, and effective strategy to prevent corrosion in MS when exposed to a 1 M HCl solution for an extended period.