To evaluate the effect of magnesium content on the microstructure and hardness of the Al-Si-Mg composites in the centrifugal casting method, three cylinders with the chemical composition of Al-20Si-XMg (X = 6, 9, 12) (as weight percent) were cast. Then the microstructure and hardness of the different radial sections were studied by optical microscope, SEM equipped with a micro-analysis system (EDS), and standard brinell hardness testing method, respectively. The phase diagram of Al-20Si-XMg system was plotted as a function of Mg% using Thermo-Calc software. Also JMat Pro software was employed to plot the variation of the mass fraction and density of the in situ formed phases during the solidification of the alloys. The results show clearly that while the coarse Mg2Si particles are formed in high Mg content alloys; however, these particles along with the primary Si particles, both, due to the low density, based on Stokes' law in fluid mechanics, are centripetally segregated towards the inner layers of the cylinders. In addition, by increasing the Mg content of the alloys from 6% to 9% then 12% the volume fraction and average size of the Mg2Si particles in inner layer of the cylinders, both, increase respectively from less than 7% to about 28% and from less than 54 microns to about 166 microns. But, since Mg2Si particles are softer than Si particles, by increasing the volume fraction of the Mg2Si particles, the hardness of the inner layers of the cylinders reduces from 86 to 81 and then 78 brinell.