Zr can be stabilized by the element selected, such as Mg-stabilized Zr (MSZ), thus providing MSZ thin films with potentially wide applications and outstanding properties. This work employed the element from alkaline earth metal stabilized Zr to investigate the electrical properties of sol–gel AZrOx (A = alkaline earth metal; Mg, Sr, Ba) as dielectric layer in metal-insulator–metal resistive random-access memory devices. In addition, the Hume–Rothery rule was used to calculate the different atomic radii of elements. The results show that the hydrolyzed particles, surface roughness, and density of oxygen vacancy decreased with decreased difference in atomic radius between Zr and alkaline earth metal. The MgZrOx (MZO) thin film has fewer particles, smoother surface, and less density of oxygen vacancy than the SrZrOx (SZO) and BaZrOx (BZO) thin films, leading to the lower high resistance state (HRS) current and higher ON/OFF ratio. Thus, a suitable element selection for the sol–gel AZrOx memory devices is helpful for reducing the HRS current and improving the ON/OFF ratio. These results were obtained possibly because Mg has a similar atomic radius as Zr and the MgOx-stabilized ZrOx.