The present paper aims to compare the corrosion protection performance of electrodeposited Ni‒P with Ni–P–C nanocomposite coatings in 3.5 wt % NaCl solution in order to assess the influence of carbon nanoparticles on corrosion behavior of these coatings, by the potentiodynamic polarisation Tafel curves and electrochemical impedance spectroscopic (EIS) techniques. The effect of heat treatment on the coatings performance was also studied. The results revealed that heat treated Ni–P–C nanocomposite coating in air at 673 K significantly improved resistance to corrosion compared with Ni–P coatings. This behavior was related to incorporation of carbon nanoparticles into Ni–P matrix using in-situ electrochemical reduction of L-lysine, which shift the corrosion potential (Ecorr) positively, also the corrosion current density (Icorr) and the double layer capacitance (Cdl) values decrease, the charge transfer resistance (Rct) and efficiencies of inhibition (IE, %) increase, indicating improvement in the corrosion resistance in seawater environment. Microstructure, phase change and chemical composition of the prepared coatings were studied using scanning electron microscopy (SEM), X-ray diffraction (XRD) and elemental microanalysis (EDX), respectively.