Carbon dots (CDs) have garnered extensive attention owing to their excellent biocompatibility, elevated specific surface area, and facile functionalization, as well as their diverse methods of preparation. In recent times, CDs have been applied for anti-corrosion and obtained some significant results. In this work, the preparation methods of CDs are first briefly introduced, and the relative merits of different approaches are highlighted. Subsequently, the application of CDs in the realm of corrosion inhibitors is discussed, and the corrosion inhibition effects and mechanism of nitrogen-doped CDs, nitrogen and sulfur-co-doped CDs, as well as CDs functionalized with other elements and nitrogen-co-doped are summarized. Finally, the application of CDs and functionalized CD-modified coatings for anti-corrosion and their protective mechanism is analyzed in detail. This review summarizes recent progress in research related to CDs and heteroatom-doped CDs in anti-corrosion applications and anticipates the prospects and applications of CDs in corrosion protection. With their unique properties and versatile applications, CDs are expected to assume a progressively pivotal role in the advancement of cutting-edge corrosion protection technologies.