In this work, we have carried out the synthesis and characterization of paints based on an epoxy resin by using polyaniline as a corrosion inhibitor for protecting the mild steel in an aggressive environment (5% NaCl). We have opted for the formulation of several epoxy paints in aim to their uses as primary layers and to compare their anticorrosion properties for the mild steel protection in saline medium. We used polyaniline and zinc phosphate (proposed by ENAP) as anticorrosion agents. During the synthesis of the paint, we controlled three parameters: density, solid content, and viscosity. Two methods, one experimental and one theoretical, have been implemented to monitor the effectiveness of the formulated. According to the results obtained by the efficiency calculations, it was found that the efficiency increased with the increase of the percentage of PANI. The weight loss method was also used to evaluate corrosion, the value of the protective efficiency reached 97,43% for 8.70 mg of polyaniline. Furthermore, in addition, the morphology of the finished samples was observed using the scanning electron microscopy. Corrosion-resistant paints must have maximum compactness to present a significant barrier effect. The grid tests allow us to evaluate the adherence of the paint and show the good behavior of our product in accelerated corrosive environment and clearly demonstrate that they preserve their adhesion properties. HIGHLIGHTS Use of polyaniline and phosphate zinc (proposed by ENAP) as anticorrosion agents. The inhibition efficacy of the studied coatings realized by two methods, one experimental and the other theoretical. The efficiency increased with the increase of the percentage of PANI. The corrosion inhibition for mild steel was studied using weight loss test and the neutral salt spray test (NSS).