In this paper, we have constructed the alloy configurations of Mg28-nAln by replacing atoms at various possible positions, starting from the stable structures of Mg28 and Al28 clusters. According to the symmetry of the cluster structure, the isomers of these initial structures have been screened with the congruence check, which would reduce computational hours and improve efficiency. Using the first-principles method, the structural evolution, mixing behavior and electronic properties of Mg28-nAln clusters are investigated for all compositions. We conclude that Al atoms prefer to reside in the central positions of Mg−Al clusters and Mg atoms tend to occupy the peripheral location. The negative mixing enthalpies imply the stabilities of these Mg-Al clusters and thus possible applications in catalysis and hydrogen storage materials. Among Mg28-nAln clusters, Mg24Al4, Mg21Al7, Mg14Al14, Mg26Al2 and Mg27Al1 present relatively high thermodynamic stabilities, and the electronic properties of these stable structures are discussed with the charge distributions around the Fermi level.