In order to reasonably design the composition of Al-Si based alloy and study the effect of alloying elements on hot crck of Al-Si based alloys, the effect of alloying elements on hot cracking of Al-Si based alloy was studied. The influence of different Si contents on the crack susceptibility index (CSI) of Al-Si alloy was calculated by using Pandat, and the influence of Mg addition on the CSI of the Al-Si-Mg alloy was also calculated. The solidification path affecting the CSI of the alloy was analyzed. The results show that when the Si content is below 10% (mass percentage), the CSI is almost non-existent and the Al-Si alloy will not show crack tendency; When the Si content reaches 11~12%, the CSI of the Al-Si alloy is very small. When the Si content reaches the hypereutectic region (Si ≥ 13%), the CSI of the Al-Si alloy begin to increase with increasing of Si content. The crack tendency of the Al-Si alloy in the hypereutectic region is larger. Adding Mg can effectively reduce the CSI of the alloy. Furthermore, with increasing of Mg content, the CSI of Al-Si-Mg alloy gradually decreases.