In order to alleviate the corrosion of metal in the pickling process, three kinds of N-doped carbon dots (N-CDs) inhibitors were obtained via the decomposition of natural citric acid derivative under various preparation temperatures (150, 180, 210 °C) for 2 h. Structural characterizations showed that N element was successfully doped into the carbon dots to form pyridine-like N, pyrrole-like N and graphitic N. Electrochemistry results implied that the corrosion current density of steel in 200 mg/L of N-CDs solutions was 24.1, 10.7 and 40.4 μA/cm2, which was greatly lower than that in 1 M HCl environment. In this case, the inhibitive efficiency of these N-CDs was higher than 90%. Through calculation, the standard adsorption free energy (ΔG0ads) of as-prepared N-CDs was −25.99, −26.94 and −25.78 kJ/mol, indicating that the adsorption film involved both physisorption and chemisorption. Furthermore, the molecular simulation calculation suggested that the as-prepared N-CDs were parallelly adsorbed on the steel/solution interface. This novel and green corrosion inhibitor was promising to solve the corrosion problem of metal equipment in the acidic process.