In order to study the strengthening effect of Mg–X (X = Zn, Ag) alloys, solid solution structures of Mg54, Mg53X1 and Mg52X2 (X = Zn, Ag) with atomic contents of 1.8 at.% and 3.7 at.% were established, respectively. The structural stability, tensile properties and electronic properties were investigated by first-principles simulation. The calculated results of cohesive energies show that all solid solution structures were stable under different tensile strains, and Mg52Ag2 had the best stability. The results of tensile tests show that Zn and Ag atoms promoted the Mg-based alloy’s yield strength and tensile strength. In addition, through comparative analyses, we have demonstrated that the tensile property of Mg-based alloys was also affected by solid solubility. Finally, the electronic density of states (DOS) and electron density difference of several solid solution structures were analyzed.