In this research, the effect of graphitic carbon nitride (g-C 3 N 4) on the corrosion protection performance of solvent-based epoxy coatings is investigated. The g-C 3 N 4 is synthesized by two-step condensation of melamine and is characterized by X-ray diffraction, Fourier transform infrared spectroscopy, transmission electron microscopy, and carbon-hydrogennitrogen elemental analysis. In order to enhance the dispersion of g-C 3 N 4 in epoxy coating, it is chemically functionalized with ethylenediamine vapor via a simple method. Further, epoxy coatings containing different amounts (0, 0.05, 0.1, 0.3, 0.5, and 0.7 wt%) of amine functionalized g-C 3 N 4 (AF g-C 3 N 4) are spray coated on mild steel substrate. The dispersion quality of nanofillers in coating matrix is studied by field emission scanning electron microscopy. The corrosion resistance of samples is investigated by electrochemical impedance spectroscopy. The results reveal the superior corrosion protection of nanocomposite coatings due to barrier performance of AF g-C 3 N 4. Meanwhile, epoxy coating containing 0.5 wt% AF g-C 3 N 4 shows the highest corrosion protection compared to pure epoxy sample. Keywords g-C 3 N 4 • Amine functionalization • Nanocomposite epoxy coating • Corrosion