Currently, magnesium alloys are gaining great interest for medical applications due to their degrading properties in the human body ensuring a great biocompatibility. These alloys also provide profitable mechanical properties due similarities with human bone. However, a difficulty in applying these materials in the biomaterials industries is the corrosion prior to cell healing. The effect of the chemical composition of Mg alloys on their corrosion behavior is well known. In this study, samples of AZ31 magnesium alloy were cut into chips for elemental chemical analysis by neutron activation analysis (NAA). Concentrations of the elements As, La, Mg, Mn, Na, Sb and Zn were determined in the AZ31 alloy. Visualization tests of agar corrosion development in various media, of 0.90% sodium chloride solution (mass), phosphate buffer saline (PBS) and simulated body fluid (SBF) were performed. Visualizations of the effect of agar gel corrosion revealed pH variation during the corrosion process due to the released into the cathode. The highest released of hydroxyl ions occurred in NaCl solution compared to PBS and SBF solutions indicating that NaCl solution was much more aggressive to the alloy compared to the others.