The anticorrosion performance of epoxy coatings can be enhanced by using biopolymer nanocomposites. The permeability of the corrosive ions through defects and pores can be prevented by the functionalization of biopolymers and their introduction into the epoxy matrix. Herein, ZnO-functionalized arabinogalactan and xylan (AG-ZnO and XL-ZnO) nanocomposites were fabricated using ultrasonication and characterized by X-ray diffraction (XRD), Fourier-transform infrared spectroscopy (FT-IR), and thermogravimetric analysis (TGA). The surface morphology of the prepared biopolymer nanocomposite was analyzed using scanning electron microscopy (SEM) and transmission electron microscopy (HR-TEM). The corrosion performance of the epoxy coating containing AG-ZnO and XL-ZnO on AISI 5140 steel was evaluated via electrochemical impedance spectroscopy (EIS) and potentiodynamic polarization studies (PDP) in 3.5 wt% NaCl. The results indicated superior corrosion protection, with inhibition efficiencies of 89.71 % and 93.27 % for the AG-ZnO and XL-ZnO incorporated epoxy coatings, respectively. Furthermore, 0.3 wt% of the prepared biopolymer nanocomposite in the epoxy coatings provided superior protection due to the increased dispersion and even distribution of zinc oxide. After the introduction of the XL-ZnO and AG-ZnO biopolymer nanocomposites, there was a threefold and twofold increase in the charge transfer resistance, respectively, compared to that of the pure epoxy coating. Compared to those of the pure epoxy (icorr = 1.23 ×10-6 A cm−2), the icorr values of the XL-ZnO-EP (icorr = 0.16 ×10-6 A cm−2) and AG-ZnO-EP (icorr = 0.65 ×10-6 A cm−2) coatings significantly decrease. The prepared coatings were subjected to water contact angle measurements and the 3D topographical morphology was determined using atomic force microscopy (AFM). A reduced roughness was observed for the prepared coatings.