The cooling curves and the change of contraction/expansion during solidification and cooling were tested by using a self-made device which could achieve the one-dimensional contraction instead of three-dimensional contraction of the casting. Then, the effects of Al content (0, 1.1, 3, 5, 10, 12.9, 15, 17, 19, 22, 24 and 30 wt%) on the thermal contraction/expansion of the binary Mg–Al as-cast alloys during solidification were obtained. The results showed that expanding instead of contraction was present in Mg–Al alloys with the addition of 0–30 wt% Al during solidification. The values of expansion significantly increased at first and then decreased with the increase in Al content. And the maximum expansion ratio of 0.44% (maximum expansion value: 0.841 mm) was present in the Mg–15 wt% Al alloy. Contraction instead of expansion occurred once the temperature drops to the temperature corresponding to the expansion value in total, indicating the occurrence of a continuous expansion during the solidification process in mushy zone for the Mg alloys with Al addition of 5–30 wt%. The expansion value in total consisted of two parts: the expansions occurring in the liquid-phase zone and mushy zone. The expansion in liquid zone was present in every Mg–Al alloy, and it contributed to the most proportion of the total expansion value when the Al content in Mg–Al alloy was lower than 10 wt% or higher than 22 wt%. However, the total expansion value was mainly determined by the solidification behavior in mushy zone when the Al content was among 10–22 wt% in Mg–Al alloys.