The purpose of this study was to optimize the biodegradability, bioactivity of magnesium alloy without anodized and anodized using nanocomposite coating of chitosan-bioactive glass by electrophoretic deposition and to study the amount of bioactive glass on coating behavior. In order to achieve this goal, first, nanopowder of bioactive glass was synthesized by sol-gel method. Then, the coating of chitosan-bioactive glass with different concentrations of bioactive glass (0.4, 0.8 and 1.2 g / l) at a voltage of 10 volts over a period of five minutes by electrophoretic deposition on magnesium alloy applied. Characterization of nanoparticles of bioactive glass and coatings was performed using scanning electron microscopy (SEM) equiped with Energy Dispersive Spectroscopy Energy Dispersive X-ray Spectroscopy, (EDS), X-ray diffraction (XRD) and Fourier Transform infrared Spectroscopy (FTIR). Hydrophobicity and roughness of coating surfaces were evaluated using roughness and wetting angle measurements, respectively. Investigating the adhesion of coatings to the substrate did using a tensile strength test. The biodegradability of coatings in the short term was evaluated using potentiodynamic polarization and electrochemical impedance spectroscopy tests. Biodegradability and bioactivity evaluation of coatings did over a period of 7 days by immersion of samples in a fluid body simulated solution (SBF) and determination of hydroxyapatite formation on the surface of coatings did using SEM equipped with EDS, XRD and FTIR. The results of the morphology of the coatings showed that by reducing the amount of bioactive glass, a more uniform coating would be created. All coatings showed good adhesion strength and the coating containing 0.4g/l of bioactive glass exhibited the highest adhesion strength. The roughness test also showed that by decreasing the amount of bioactive glass, the roughness of the coating surface decreases. The wettability test showed an increase of hydrophobicity coating by increasing the amount of bioactive glass. Also, the results of electrochemical corrosion tests showed that all coatings can control the degradability of magnesium alloy, however, the coating containing 0.4 g / l of bioactive glass showed better corrosion resistance. Therefore, the coating containing 0.4 g / l of bioactive glass was selected as the optimum coating. In order to further control the biodegradability of magnesium alloy, an optimum coating was applied to anodized magnesium alloy. The results showed that anodizing has a significant effect on increasing the corrosion resistance and adhesion of optimum coating. Keywords: Magnesium alloy, Bioactive glasses, Chitosan, Nanocomposite coating, Electrophoretic deposition, Anodizing