In recent years, magnesium alloys continue to receive attention due to their low density and high specific strength compared to other metallic materials. However, the main disadvantage of magnesium alloys originates from the low standard reduction potential of magnesium (-2.37 VSHE), resulting in high reactivity in water-containing environments and susceptibility to corrosion reaction. This kind of corrosion phenomenon exists in most magnesium alloys, thus limiting their practical applications.At present, many studies showed that adding yttrium to magnesium can simultaneously improve its creep and corrosion resistance. Also, the standard reduction potential of yttrium is similar to that of magnesium, which implies that the galvanic corrosion effect due to the second phases or precipitates would be less pronounced with the addition of yttrium. Therefore, in this study, we investigated the influence of alloy microstructure on the corrosion behavior of two binary magnesium-yttrium (Mg-Y) alloys with different yttrium content.To understand the dominant features during corrosion tests, this study used an in situ optical microscope (OM)/three-electrode setup to monitor the evolution in corrosion potential and surface corrosion morphology with immersion times of the Mg-Y alloys. With this setup, serious localized corrosion was observed on the Mg-1wt%Y sample. In contrast, localized corrosion on the Mg-7wt%Y sample is mitigated, and the corrosion rate is maintained at a similar level over time. Even though the addition of more Y results in more second phases or precipitates, which could cause some galvanic effect, the corrosion propagation is delayed by the second phase distribution. Through further observation in scanning electron microscope (SEM) and focused ion beam (FIB) systems, the corrosion mechanism of binary Mg-Y alloys will be discussed based on the distribution of local cathodes and anodes on the alloy surface. Figure 1